DBaker7777
Board Regular
- Joined
- Feb 3, 2009
- Messages
- 53
- Office Version
- 365
- 2016
I have the following code that works great. I want to add a formula to column S to Sheet2 each time a row is pasted. The formula would need to increment each time it is pasted.
Something like
=IF(L1>Sheet1!$A$1,"NEW","") and the Next formula that gets placed in should be =IF(L2>Sheet1!$A$1,"NEW,"") and so on . Any help would be greatly appreciated.
Something like
=IF(L1>Sheet1!$A$1,"NEW","") and the Next formula that gets placed in should be =IF(L2>Sheet1!$A$1,"NEW,"") and so on . Any help would be greatly appreciated.
VBA Code:
Private Sub CommandButton2_Click()
Dim lastrow as long
lastrow=Sheets("Sheet2").Range("A655536").End(xlup).row+1
Activeworkbook.Sheets("Sheet1").Range("A1:R1").copy
Activeworkbook.Sheets("Sheet2").Range("A" & lastrow).pastespecial Paste=xlpastevalue
End Sub