S
scolbert
I've got a workbook where I'm using code to copy rows of data from one sheet
to a recap sheet if a condition is met (all rows with "Y" in one column).
The data is being copied to sheet two, but blank rows are being left in
between rows where the "Y" condition is not met. My current code is:
'have x start at row 2
x = 2
'loop until a blank row is found
Do While Sheets("Jan 09").Cells(x, 1).Value <> ""
If Sheets("Jan 09").Cells(x, 11).Value = "Y" Then
'this will put the value of column 1 "Payable To" in the recap
sheet
Sheets("2009 Recap").Select
Cells(x, 1).Value = Sheets("Jan 09").Cells(x, 1)
End If
'increase the value of x by 1 to act on the next row
x = x + 1
Loop
all assistance is appreciated!
to a recap sheet if a condition is met (all rows with "Y" in one column).
The data is being copied to sheet two, but blank rows are being left in
between rows where the "Y" condition is not met. My current code is:
'have x start at row 2
x = 2
'loop until a blank row is found
Do While Sheets("Jan 09").Cells(x, 1).Value <> ""
If Sheets("Jan 09").Cells(x, 11).Value = "Y" Then
'this will put the value of column 1 "Payable To" in the recap
sheet
Sheets("2009 Recap").Select
Cells(x, 1).Value = Sheets("Jan 09").Cells(x, 1)
End If
'increase the value of x by 1 to act on the next row
x = x + 1
Loop
all assistance is appreciated!