mostafaelkady98
New Member
- Joined
- Aug 18, 2022
- Messages
- 3
- Office Version
- 2019
- Platform
- Windows
Hi all, I am new to VBA macros
I am trying to create a macro that adds a row at the end of specific rows while clearing the values and keeping the formulas.
Thanks a lot, best regards
I am trying to create a macro that adds a row at the end of specific rows while clearing the values and keeping the formulas.
but when I click it clears all cells in my sheet, not the specified row onlySub RectangleAddRow_Click()
With Worksheets("Lintel Calculation")
.Range("TotalLintelVolume").Offset(-2).EntireRow.Copy
.Range("TotalLintelVolume").Offset(-1).EntireRow.Insert Shift:=xlShiftDown
On Error Resume Next
.Range("TotalLintelVolume").Offset(-2).SpecialCells(xlCellTypeConstants).Value = ""
Application.CutCopyMode = False
On Error GoTo 0
End With
End Sub
Thanks a lot, best regards