View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Mattie Mattie is offline
external usenet poster
 
Posts: 4
Default Macro code to test for blank row and insert blank row if false

Below is the code I am using to insert a blank row between text pasted to
Excel at various times. However, I would like to add a test if a blank row
exists between rows of text, then do not insert another blank row. Here's
what I currently have:

Sub InsertRows()
Dim RowNdx As Long
Dim LastRow As Long

LastRow = Cells(Rows.Count, "A").End(xlUp).Row
For RowNdx = LastRow To 2 Step -1
Rows(RowNdx).Insert
Next RowNdx

End Sub

Any ideas?