Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 47
Default VB Msgbox result

Sub Print_All_Sections()
'
' Print_All_Sections Macro
' Macro recorded 05/07/2008 by Log-In
'
' Keyboard Shortcut: Ctrl+p

MsgBox "This Will Print All Sections Sheets", vbYesNo
If vbresponce = No Then Exit Sub

Sheets(Array("Not Here", "transport", "forklift", "Carousel", "B & L",
"C & D", _
"Managers", "Admin", "Tipping", "E", "F", "G", "H", "W W
Irish")).Select
Sheets("W W Irish").Activate
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Sheets("Control").Select
ActiveWindow.SmallScroll Down:=-12
End Sub


want the code to cancel printing if no is clicked but print all if yes is
clicked but its not playing

any ideas
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default VB Msgbox result

Maybe...

Option Explicit
Sub Print_All_Sections()

dim Resp as long

resp = MsgBox(prompt:="This Will Print All Sections Sheets", _
buttons:=vbYesNo)

If resp = vbNo Then
Exit Sub
End if

Sheets(Array("Not Here", "transport", "forklift", "Carousel", "B & L", _
"C & D", "Managers", "Admin", "Tipping", "E", "F", "G", _
"H", "W W Irish")).printout Copies:=1, Collate:=True

End Sub



Rich wrote:

Sub Print_All_Sections()
'
' Print_All_Sections Macro
' Macro recorded 05/07/2008 by Log-In
'
' Keyboard Shortcut: Ctrl+p

MsgBox "This Will Print All Sections Sheets", vbYesNo
If vbresponce = No Then Exit Sub

Sheets(Array("Not Here", "transport", "forklift", "Carousel", "B & L",
"C & D", _
"Managers", "Admin", "Tipping", "E", "F", "G", "H", "W W
Irish")).Select
Sheets("W W Irish").Activate
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Sheets("Control").Select
ActiveWindow.SmallScroll Down:=-12
End Sub

want the code to cancel printing if no is clicked but print all if yes is
clicked but its not playing

any ideas


--

Dave Peterson
Reply
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
Need "if" with msgbox result [email protected] Excel Discussion (Misc queries) 4 April 16th 09 04:10 PM
Macro - msgbox vs. enter result in a cell??/ [email protected] Excel Programming 1 July 11th 06 01:06 AM
Advanced formula - Return result & Show Cell Reference of result Irv Excel Worksheet Functions 7 May 6th 06 03:36 AM
Importing result from Access query to Excel but the result only c. Edwin Excel Discussion (Misc queries) 0 March 16th 06 01:36 AM
vlookup based on random result returns incorrect result rickat Excel Worksheet Functions 1 December 6th 05 01:16 PM


All times are GMT +1. The time now is 07:45 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"