jlabrecque
New Member
- Joined
- Nov 7, 2018
- Messages
- 14
So I have this code that works to add rows to a table.
Sub insert_rows()
Dim x As Integer
x = Application.InputBox("Number of Rows", "Number of Rows", Type:=1)
Range("A" & Rows.Count).End(xlUp).Select
Range(ActiveCell, ActiveCell.Offset(x - 1, 0)).EntireRow.Insert Shift:=xlDown
End Sub
If you are using blue and white row 1 would be blue and row 2 white and row 3 blue again etc.
When the above code is used. The table loses its format as discussed above
I think the problem is occurring with how I am selecting the range.
Any advice is appreciated
Sub insert_rows()
Dim x As Integer
x = Application.InputBox("Number of Rows", "Number of Rows", Type:=1)
Range("A" & Rows.Count).End(xlUp).Select
Range(ActiveCell, ActiveCell.Offset(x - 1, 0)).EntireRow.Insert Shift:=xlDown
End Sub
If you are using blue and white row 1 would be blue and row 2 white and row 3 blue again etc.
When the above code is used. The table loses its format as discussed above
I think the problem is occurring with how I am selecting the range.
Any advice is appreciated
Last edited: