LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Pop up in excel

thanks a lot... it works now.. u guys are the best.

Rick Rothstein (MVP - VB) wrote:
You would put the code lines in front so it would look like this...

Sub Your Macro()
'
' Any lines of code you may have above the printout line
'
Continue = MsgBox("Are you sure you want to print it?", vbYesNo)
If Continue = vbNo Then Exit Sub
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
End Sub

Not what will happen is the macro you are running will stop running if the
user answers No. If you have other code after this and the printing is only
one of many statements, then you should code it like this...

Sub Your Macro()
'
' Any lines of code you may have above the printout line
'
Continue = MsgBox("Are you sure you want to print it?", vbYesNo)
If Continue = vbYes Then
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
End If
'
' The rest of your code goes here
'
End Sub

Rick

hi.. i am sorry i not very god a macro.. i am still in learning stsge.
could you tel me if i have to paste the below command in macro before are

[quoted text clipped - 18 lines]

can any one help me with this please.


 
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



All times are GMT +1. The time now is 10:41 AM.

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

About Us

"It's about Microsoft Excel"