Forum Discussion

JT_FrankGroup's avatar
JT_FrankGroup
Copper Contributor
Aug 10, 2022
Solved

VBA Code - Autofill Down - Copying two cells down to the end of the last row

Need help correcting a Macro that will automatically copy data in two cells down to the last row.  I have attempted to use the other conversations similar to this to fix error I am receiving but I co...
  • HansVogelaar's avatar
    HansVogelaar
    Aug 10, 2022

    JT_FrankGroup 

    Try this version:

    Sub CopyDownAA_AB()
        Dim LastRow As Long
        LastRow = Cells.Find(What:="*", SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row
        Range("AA2:AB2").AutoFill Destination:=Range("AA2:AB" & LastRow)
    End Sub

     

Resources