Does someone have time to help me finish up what I think should be a simple Loop? I've struggled way too long on this and am just not getting it!
Purpose: to take a sheet of 1500 rows and 10 columns, evaluate col A and if it is a "Y" then copy that row to another worksheet and print that other worksheet. It would be nice to look at col B for max # of rows instead of processing all 1500, but that isn't necessary. Here is what I have so far and it is just returning the first row:
Sub PrintInv6()
'
' PrintInv6 Macro
'
'
Application.Goto Reference:="R6C1"
For i = 1 To 6
If Cells(i, 1).Value = "Y" Then
ActiveCell.Range("A1:J1").Select
Selection.Copy
Sheets("Invoice").Select
Application.Goto Reference:="R17C9"
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _
IgnorePrintAreas:=False
Sheets("Billing Detail").Select
Else: End If
Next i
Sheets("Billing Detail").Select
ActiveCell.Offset(-4, 8).Range("A1").Select
Application.CutCopyMode = False
End Sub
Thank you.
Purpose: to take a sheet of 1500 rows and 10 columns, evaluate col A and if it is a "Y" then copy that row to another worksheet and print that other worksheet. It would be nice to look at col B for max # of rows instead of processing all 1500, but that isn't necessary. Here is what I have so far and it is just returning the first row:
Sub PrintInv6()
'
' PrintInv6 Macro
'
'
Application.Goto Reference:="R6C1"
For i = 1 To 6
If Cells(i, 1).Value = "Y" Then
ActiveCell.Range("A1:J1").Select
Selection.Copy
Sheets("Invoice").Select
Application.Goto Reference:="R17C9"
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _
IgnorePrintAreas:=False
Sheets("Billing Detail").Select
Else: End If
Next i
Sheets("Billing Detail").Select
ActiveCell.Offset(-4, 8).Range("A1").Select
Application.CutCopyMode = False
End Sub
Thank you.