Earth_shaker
New Member
- Joined
- Jan 7, 2022
- Messages
- 2
- Office Version
- 365
- Platform
- Windows
- Mobile
Looking to remove ActiveCell and have it use a specific cell "A4" as the insert location.
Also, in Column A of my table I have a simple Formula =ROW(A1) that gives the result 1. When I insert the rows, it makes them all =ROW(A2) with the result of 2,2,2,2, instead of ...A2, A3, A4, resulting in 2,3,4,etc.
"Sub InsertRows()
Dim i As Integer, j As Integer
ActiveCell.EntireRow.Select
On Error GoTo last
i = InputBox("Enter the number of Holes in Shot", "Complete")
For j = 1 To i - 1
Selection.Insert Shift:=xltodown, copyOrigin:=xlFormatFromLeftOrAbove
Next j
last:
Exit Sub
End Sub"
Also, in Column A of my table I have a simple Formula =ROW(A1) that gives the result 1. When I insert the rows, it makes them all =ROW(A2) with the result of 2,2,2,2, instead of ...A2, A3, A4, resulting in 2,3,4,etc.
"Sub InsertRows()
Dim i As Integer, j As Integer
ActiveCell.EntireRow.Select
On Error GoTo last
i = InputBox("Enter the number of Holes in Shot", "Complete")
For j = 1 To i - 1
Selection.Insert Shift:=xltodown, copyOrigin:=xlFormatFromLeftOrAbove
Next j
last:
Exit Sub
End Sub"