Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a list of data as such.
112526 name 254412 name 125421 name 254412 name 254412 The first column will always have a value in it but the second and third columns may not have values in them. Is it possible to have a macro run down the list and any items which it doesnt have values in columns b and c to copy to another sheet? |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Finding MIN across worksheets while excluding blanks | Excel Worksheet Functions | |||
Help with sorting blanks out of a list | Excel Discussion (Misc queries) | |||
Condense out blanks in a list | Excel Discussion (Misc queries) | |||
validation list blanks | Excel Worksheet Functions | |||
Finding blanks in dynamic ranges | Excel Programming |