VBA Help with Copying & pasting data to the last row

MICHAELREXCEL

New Member
Joined
Oct 4, 2016
Messages
17
Hello,

I am trying to copy data from row 160 and paste it on rows 161 to 183 (the last row). Normally, this code would be easy to write, however rows 161 to 183 have blank cells at the beginning. Therefore, I cannot do the typical "range.end" methodology. Also, the row numbers will change all the time since the amount of data frequently changes.

Is there a way to write a VBA code that does this? Any help is welcomed.

Thanks
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
What column can be looked to determine where the last row of data is?
 
Upvote 0
You cannot upload files to this site. But there are tools you can use to post screen images. They are listed in Section B of this link here: Guidelines for Forum Use.

Also, there is a Test Here forum on this board that you can use to test out these tools to make sure they are working correctly before using them in your question.

Are you looking for some code like this?
Code:
    Dim lastRow As Long
    
'   Find last row in column K with data
    lastRow = Cells(Rows.Count, "K").End(xlUp).Row
    
'   Fill column A from row 161 to last row with value in A160
    Range("A160:A" & lastRow) = Range("A160")
 
Upvote 0

Forum statistics

Threads
1,214,972
Messages
6,122,530
Members
449,088
Latest member
RandomExceller01

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