Forum Discussion

starr0650's avatar
starr0650
Copper Contributor
Aug 19, 2021
Solved

Count rows, end up will not work with only one row

I'm using the below code to find the last row, then autofill column A.  LR = Cells(Rows.Count, 4).End(xlUp).Row Range("A2").AutoFill Destination:=Range("A2:A" & LR)   It works unless there is o...
  • HansVogelaar's avatar
    Aug 19, 2021

    starr0650 

    For example:

        LR = Cells(Rows.Count, 4).End(xlUp).Row
        If LR <> 2 Then
            Range("A2").AutoFill Destination:=Range("A2:A" & LR)
        End If

Resources