Hey folks,
Could someone have alook at the below and tell me what Im doing wrong.
![]()
Please Login or Register to view this content.
Hey folks,
Could someone have alook at the below and tell me what Im doing wrong.
![]()
Please Login or Register to view this content.
"'But the last row will vary each time."
What do you mean by this please? You could maybe try something like:
Selection.AutoFill Destination:=Range("A2:A" & activesheet.rows.count)
Cheers for that mate.
The contents of the Dumpfile will differ from week to week as such the maximum row will vary.
That solution does the job alright, but I was hoping to work out somthing that just applied the formula down to the last populated row, rather than the entire file. Just for the sake of being tidy.
There's a few ways to do that - as long as the cell formatting is uniform down the row this one should work fine:
Selection.AutoFill Destination:=Range("A2:A" & range("A60000").end(xlup).row)
That doesnt seem to work for me here.
Error: 'Autofill method of Range class failed'
?
try this:
If Range("A60000").End(xlUp).Row > 2 Then
Selection.AutoFill Destination:=Range("A2:A" & Range("A60000").End(xlUp).Row)
End If
Hi TonyforVBA
This code finds the last row and fills down to that row![]()
Please Login or Register to view this content.
John
If you have issues with Code I've provided, I appreciate your feedback.
In the event Code provided resolves your issue, please mark your Thread as SOLVED.
If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks