gheyman
Well-known Member
- Joined
- Nov 14, 2005
- Messages
- 2,341
- Office Version
- 365
- Platform
- Windows
I am trying to write this code to find the last row that has data (in that specific column of a table) and copy it. Then paste it from that cell down to the last row of the table.
The code is copying the last row in my table - not the last row in column J that has data. Also the code is stoping there. It is not selecting the cells to paste into (yes my code does not have the step to paste - but its not even selecting.
Not that column J is a data validation list. So I dont know if thats the reason it thinks there is data all the way to the bottom of Row J. As of now my data, in column J only goes down to row 43 and there are 45 rows in my table.
Thank you for your time and help!
The code is copying the last row in my table - not the last row in column J that has data. Also the code is stoping there. It is not selecting the cells to paste into (yes my code does not have the step to paste - but its not even selecting.
Not that column J is a data validation list. So I dont know if thats the reason it thinks there is data all the way to the bottom of Row J. As of now my data, in column J only goes down to row 43 and there are 45 rows in my table.
Code:
Sub FillResourceStep3()
Dim LRResource As Long
Dim LRStep3
Sheets("Step 3").Select
LRResource = Cells(Rows.Count, "J").End(xlUp).Row
LRStep3 = Cells(Rows.Count, "C").End(xlUp).Row
Range("J" & LRResource).Copy
Range("J" & LRResource & ":" & "J" & LRStep3).Select
End Sub