LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 32
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Looping Problem Paul Black Excel Programming 3 September 17th 05 09:59 AM
Looping problem Sleeping Bear Excel Programming 2 July 7th 05 07:41 PM
Looping Problem . . .Argh! ed Excel Programming 6 December 17th 04 04:18 PM
If Then Else looping problem Kieran1028[_12_] Excel Programming 1 November 11th 04 06:27 PM
Looping Problem Todd Huttenstine[_3_] Excel Programming 5 January 25th 04 12:51 AM


All times are GMT +1. The time now is 04:54 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"