View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Edward Ulle Edward Ulle is offline
external usenet poster
 
Posts: 92
Default Finding Blanks in list

Try this

Option Explicit

Public Sub Test()

Dim wsSource As Worksheet
Dim wsDest As Worksheet
Dim iRow As Integer
Dim jRow As Integer

Set wsSource = Worksheets("Source")
Set wsDest = Worksheets("Dest")

iRow = 0
jRow = 0
Do While Not IsEmpty(wsSource.Range("A1").Offset(iRow, 0))
If IsEmpty(wsSource.Range("A1").Offset(iRow, 1)) Then
iRow = iRow + 1
jRow = jRow + 1
wsSource.Rows(iRow).Copy (wsDest.Rows(jRow))
ElseIf IsEmpty(wsSource.Range("A1").Offset(iRow, 2)) Then
iRow = iRow + 1
jRow = jRow + 1
wsSource.Rows(iRow).Copy (wsDest.Rows(jRow))
Else
iRow = iRow + 1
End If
Loop

End Sub




*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!