Select Last Row of Specified Columns and Drag Formula Down

David04Ruiz

New Member
Joined
Aug 29, 2022
Messages
18
Office Version
  1. 365
Platform
  1. Windows
Hi all,

I'm trying to figure out a formula that would allow me to select the last row of data for columns A-C and then drag that formula down to the last row of data based on column D. In the case of the image I attached, I would need to select cells (602A:602C) and then drag the formula in those cells down to cells (620A:620C).

The actual row will not be 602 like in the picture (it changes daily as we add data), but we will always be selecting column A-C only.

Does anyone have a method of doing this? Thank you so much in advance!!
 

Attachments

  • Screenshot 2022-08-29 180730.png
    Screenshot 2022-08-29 180730.png
    64.5 KB · Views: 12

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
Assuming that you meant code rather than formula then maybe something like the code below

VBA Code:
Sub Ruiz()
    Dim Lrow As Long, Lrow2 As Long
    Application.ScreenUpdating = False

    Lrow = Columns("A:C").Find("*", , xlValues, , xlByRows, xlPrevious).Row
    Lrow2 = Columns("D").Find("*", , xlValues, , xlByRows, xlPrevious).Row
    Range(Cells(Lrow, "A"), Cells(Lrow, "C")).AutoFill Range(Cells(Lrow, "A"), Cells(Lrow2, "C"))

    Application.ScreenUpdating = True
End Sub
 
Upvote 0
Solution
Assuming that you meant code rather than formula then maybe something like the code below

VBA Code:
Sub Ruiz()
    Dim Lrow As Long, Lrow2 As Long
    Application.ScreenUpdating = False

    Lrow = Columns("A:C").Find("*", , xlValues, , xlByRows, xlPrevious).Row
    Lrow2 = Columns("D").Find("*", , xlValues, , xlByRows, xlPrevious).Row
    Range(Cells(Lrow, "A"), Cells(Lrow, "C")).AutoFill Range(Cells(Lrow, "A"), Cells(Lrow2, "C"))

    Application.ScreenUpdating = True
End Sub
Yes code not formula, my bad wasn't thinking lol. That worked perfectly thanks so much!!
 
Upvote 0

Forum statistics

Threads
1,216,309
Messages
6,130,002
Members
449,552
Latest member
8073662045

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top