jardenp
Active Member
- Joined
- May 12, 2009
- Messages
- 373
- Office Version
- 2019
- 2016
- 2013
- 2011
- 2010
- Platform
- Windows
I have a need similar to the one in this post: http://www.mrexcel.com/forum/showthread.php?t=483690&highlight=adding+rows+VBA
VoG's code was:
I've tried to change the code, but I don't understand how it works well enough to successfully manipulate it.
Instead of adding 2 rows after every couple rows, I need to add 1 row below each existing row. My first row is column headers and then I have an indeterminate number of rows with data. The data rows are contiguous, so there are no gaps to worry about (if that matters).
Thanks!
VoG's code was:
Code:
Sub InsRows()
Dim LR As Long, i As Long
LR = Range("A" & Rows.Count).End(xlUp).Row
For i = LR - 1 To 3 Step -2
Rows(i).Resize(2).Insert
Next i
End Sub
Instead of adding 2 rows after every couple rows, I need to add 1 row below each existing row. My first row is column headers and then I have an indeterminate number of rows with data. The data rows are contiguous, so there are no gaps to worry about (if that matters).
Thanks!