Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Looping problem........
Hi
I would like to have a loop in the code below so that it only goes to Print Preview/Print when A1,A2 & A3 don't equal "ERR". ( This is only an example the actual range would be "A1:A10"). I would still like the messages to display so the user knows what they need to look at. I'm not sure whether or not it is For/Next or Do Until or both. I'd be grateful for your help. Regards Steve Sub PRINTDoc() Dim Name As String Name = Range("b1").Value ' displays username Application.ScreenUpdating = False If Range("a1").Value = "ERR" Then MsgBox (Name & ", Please check Qty.") If Range("a2").Value = "ERR" Then MsgBox (Name & ", Please check Account No.") If Range("a3").Value = "ERR" Then MsgBox (Name & ", Please check Value.") ActiveSheet.PageSetup.PrintArea = "$A$59:$J$116" ' ActiveWindow.SelectedSheets.PrintOut Copies:=1 ActiveWindow.SelectedSheets.PrintPreview End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Looping Problem | Excel Programming | |||
Looping problem | Excel Programming | |||
Looping Problem . . .Argh! | Excel Programming | |||
If Then Else looping problem | Excel Programming | |||
Looping Problem | Excel Programming |