SouthernGent0327
New Member
- Joined
- Jan 30, 2021
- Messages
- 14
- Office Version
- 365
- Platform
- Windows
I have a master spreadsheet which contains a data log. The data log contains complex formulas, so I would like an entire row to copy to a different column as just values (no formulas) automatically when new data is added to the sheet. I started out creating a module with the following code that will only copy the first row repeatedly.
I would really like this to happen automatically every time new data is added to the sheet. Please help and any information is greatly appreciated.
VBA Code:
Dim sh As Worksheet
Dim lRow1 As Long
Dim lRow2 As Long
Dim i As Long
Set sh = ActiveSheet
lRow1 = sh.Range("AE" & Rows.Count).End(xlUp).Row
lRow2 = sh.Range("AM" & Rows.Count).End(xlUp).Offset(1, 0).Row
With sh.Range("AE13" & ":AJ" & lRow1)
sh.Cells(lRow2, "AM").Resize(1, .Columns.Count).Value = .Value
lRow2 = lRow2 + 1
End With
End Sub
I would really like this to happen automatically every time new data is added to the sheet. Please help and any information is greatly appreciated.