I am tweaking a macro. I need to add a condition to it. I only need the Else part to run if Col O ="P" and Col L = 1. Right now the first part runs when col O = "C" and Col L = 1 then the else part runs on everything else. If the rows of data don't fit into these 2 groups I don't need anything done to them.
What do I need to do?
Thank you for your time and help.
Here is code now.
lngRowNo = 12
intPrintCounter = 0
Sheets("CL lookup").Select
Range("B" & lngRowNo).Select
Do Until IsEmpty(ActiveCell) = True
If StrConv(Range("O" & lngRowNo), vbUpperCase) = "C" And Range("L" & lngRowNo).Value = 1 Then
ActiveCell.Copy Sheets("Invoice").Range("N1")
Sheets("Invoice").Copy after:=Worksheets(Worksheets.Count)
ActiveSheet.Name = Range("I7").Value
Sheets("CL lookup").Select
lngRowNo = lngRowNo + 1
intPrintCounter = intPrintCounter + 1
Range("B" & lngRowNo).Select
Else
ActiveCell.Copy Sheets("Invoice").Range("N1")
Sheets("Invoice").PrintOut
lngRowNo = lngRowNo + 1
Range("B" & lngRowNo).Select
End If
Loop
Bookmarks