Hi
Im constantly copying & pasting data from 1 sheet to another & then i need to find the last row & add 1 to it so when i copy/paste the next set of data, it starts from the next row however the variable lrow always returns 1, like it resets its value or never changes to the actual last row. Any ideas? Its driving me mad!
Im constantly copying & pasting data from 1 sheet to another & then i need to find the last row & add 1 to it so when i copy/paste the next set of data, it starts from the next row however the variable lrow always returns 1, like it resets its value or never changes to the actual last row. Any ideas? Its driving me mad!
VBA Code:
sum example()
dim lrow as long
lrow = Sheets("Sheet2").Range("A" & Rows.Count).End(xlUp).Row
Application.ScreenUpdating = True
'
Sheets("MTB").Select
Range("I6:J212").Select
Selection.Copy
Sheets("Sheet2").Select
Range("A1").Select
MsgBox lrow 'at this point, lrow returns 1 (which is fine)
Selection.PasteSpecial Paste:=xlPasteValues
lrow = lrow + 1 'lrow now returns 2 (should be 213)
MsgBox lrow
Range("A" & lrow).Select
MsgBox lrow
end sub
Last edited: