The 7 lines of code you have between the For Line and the Next line can be
replaced with the following 3 lines of code:
''' Just one alternative,,,
FWIW...
"abcdexcel" <abcdexcel.21d7o0_1136806204.5255@excelforum-nospam.com> wrote in
message news:abcdexcel.21d7o0_1136806204.5255@excelforum-nospam.com...
>
> Hi
>
> Being very new to excel coding, this code might be lengthy, but it
> works.
>
> Public Sub insert_row()
> Const TestColumn As Long = 1 'have taken column A as 1, thus B would be
> 2'
> Dim cRows As Long
> Dim i As Long
>
> cRows = Cells(Rows.Count, TestColumn).End(xlUp).Row
> For i = cRows To 2 Step -1
> If Cells(i, TestColumn).Value <> IsNotBlank Then
> Cells(i, TestColumn).EntireRow.Insert
> Cells(i, TestColumn).EntireRow.Insert
> Cells(i, TestColumn).EntireRow.Insert
> Cells(i, TestColumn).EntireRow.Insert
> Cells(i, TestColumn).EntireRow.Insert
> End If
> Next i
>
> End Sub
>
>
> Hope this suffice your cause.
>
> SAS
>
>
> --
> abcdexcel
> ------------------------------------------------------------------------
> abcdexcel's Profile:
> http://www.excelforum.com/member.php...o&userid=30021
> View this thread: http://www.excelforum.com/showthread...hreadid=499280
>
Bookmarks