Pantoffsky
New Member
- Joined
- Jan 26, 2016
- Messages
- 14
- Office Version
- 2019
- Platform
- Windows
Hi all,
I have a issue with the following part of code:
It's supposed to add rows based on a formula after the last row in the sheet "Work". But instead of putting them after the last row, the last row is is overwritten. What am I doing wrong?
Many Thanks!
I have a issue with the following part of code:
VBA Code:
Sub addRows()
Dim UsdRws As Long
UsdRws = Sheets("Report").Range("G" & Rows.Count).End(xlUp).Row
Sheets("Work").Range("A" & Rows.Count).End(xlUp).Resize(UsdRws - 0).Formula = "=blablaformula"
Sheets("Work").Cells.Copy
Sheets("Work").Cells.PasteSpecial Paste:=xlPasteValues
Application.CutCopyMode = False
End Sub
It's supposed to add rows based on a formula after the last row in the sheet "Work". But instead of putting them after the last row, the last row is is overwritten. What am I doing wrong?
Many Thanks!