Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
i have a report sheet which includes 3 pages but not everybody needs 3 pages
to print is there a code that once i click print then it would give me an option eg: please select an option 1. for 1st page 2. 2nd page 3. 3rd page 4. all the pages many thanks jez |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
This option is already there in the Print option provided by Excel.
See the 'Print Range' block... "jaz" wrote: i have a report sheet which includes 3 pages but not everybody needs 3 pages to print is there a code that once i click print then it would give me an option eg: please select an option 1. for 1st page 2. 2nd page 3. 3rd page 4. all the pages many thanks jez |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
sheeloo
i have people that dont know how to do that therefore i want it something else more flashy a pop up basically, that makes it easier for them once they click print object then they select 1,2,3, etc "Sheeloo" wrote: This option is already there in the Print option provided by Excel. See the 'Print Range' block... "jaz" wrote: i have a report sheet which includes 3 pages but not everybody needs 3 pages to print is there a code that once i click print then it would give me an option eg: please select an option 1. for 1st page 2. 2nd page 3. 3rd page 4. all the pages many thanks jez |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Try this macro
Sub printPages() Dim response As Integer Dim msg As String msg = msg & "Please select an option: " & vbCrLf msg = msg & " 1. for 1st page: " & vbCrLf msg = msg & " 2. 2nd page: " & vbCrLf msg = msg & " 3. 3rd page: " & vbCrLf msg = msg & " 4. all the pages: " & vbCrLf response = Application.InputBox(msg) If (response < 1 And response < 2 And response < 3 _ And response < 4) Then MsgBox "Wrong Choice!" & vbCrLf & "Try again." Exit Sub End If If response = 4 Then ActiveSheet.PrintOut 1, 3 Else ActiveSheet.PrintOut response, response End If End Sub "jaz" wrote: sheeloo i have people that dont know how to do that therefore i want it something else more flashy a pop up basically, that makes it easier for them once they click print object then they select 1,2,3, etc "Sheeloo" wrote: This option is already there in the Print option provided by Excel. See the 'Print Range' block... "jaz" wrote: i have a report sheet which includes 3 pages but not everybody needs 3 pages to print is there a code that once i click print then it would give me an option eg: please select an option 1. for 1st page 2. 2nd page 3. 3rd page 4. all the pages many thanks jez |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
sheeloo
thank you very much for that and it does work fantastic but only if i go to tools-macros-run macro is there any other way to do it like when i click printer icon? sorry am rubish with macros and thanks for taking the time to help much appreciated jez "Sheeloo" wrote: Try this macro Sub printPages() Dim response As Integer Dim msg As String msg = msg & "Please select an option: " & vbCrLf msg = msg & " 1. for 1st page: " & vbCrLf msg = msg & " 2. 2nd page: " & vbCrLf msg = msg & " 3. 3rd page: " & vbCrLf msg = msg & " 4. all the pages: " & vbCrLf response = Application.InputBox(msg) If (response < 1 And response < 2 And response < 3 _ And response < 4) Then MsgBox "Wrong Choice!" & vbCrLf & "Try again." Exit Sub End If If response = 4 Then ActiveSheet.PrintOut 1, 3 Else ActiveSheet.PrintOut response, response End If End Sub "jaz" wrote: sheeloo i have people that dont know how to do that therefore i want it something else more flashy a pop up basically, that makes it easier for them once they click print object then they select 1,2,3, etc "Sheeloo" wrote: This option is already there in the Print option provided by Excel. See the 'Print Range' block... "jaz" wrote: i have a report sheet which includes 3 pages but not everybody needs 3 pages to print is there a code that once i click print then it would give me an option eg: please select an option 1. for 1st page 2. 2nd page 3. 3rd page 4. all the pages many thanks jez |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
or can i have a button on the sheet with print icon?
"Sheeloo" wrote: Try this macro Sub printPages() Dim response As Integer Dim msg As String msg = msg & "Please select an option: " & vbCrLf msg = msg & " 1. for 1st page: " & vbCrLf msg = msg & " 2. 2nd page: " & vbCrLf msg = msg & " 3. 3rd page: " & vbCrLf msg = msg & " 4. all the pages: " & vbCrLf response = Application.InputBox(msg) If (response < 1 And response < 2 And response < 3 _ And response < 4) Then MsgBox "Wrong Choice!" & vbCrLf & "Try again." Exit Sub End If If response = 4 Then ActiveSheet.PrintOut 1, 3 Else ActiveSheet.PrintOut response, response End If End Sub "jaz" wrote: sheeloo i have people that dont know how to do that therefore i want it something else more flashy a pop up basically, that makes it easier for them once they click print object then they select 1,2,3, etc "Sheeloo" wrote: This option is already there in the Print option provided by Excel. See the 'Print Range' block... "jaz" wrote: i have a report sheet which includes 3 pages but not everybody needs 3 pages to print is there a code that once i click print then it would give me an option eg: please select an option 1. for 1st page 2. 2nd page 3. 3rd page 4. all the pages many thanks jez |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On the Control toolbar
Click on Command Button Then draw one where you want Right-Click and paste the code in the View Code window In properties (Categorized view) click on ... next to picture and choose the image you want Click on Design button on the Control toolbar to exit design mode "jez" wrote: or can i have a button on the sheet with print icon? "Sheeloo" wrote: Try this macro Sub printPages() Dim response As Integer Dim msg As String msg = msg & "Please select an option: " & vbCrLf msg = msg & " 1. for 1st page: " & vbCrLf msg = msg & " 2. 2nd page: " & vbCrLf msg = msg & " 3. 3rd page: " & vbCrLf msg = msg & " 4. all the pages: " & vbCrLf response = Application.InputBox(msg) If (response < 1 And response < 2 And response < 3 _ And response < 4) Then MsgBox "Wrong Choice!" & vbCrLf & "Try again." Exit Sub End If If response = 4 Then ActiveSheet.PrintOut 1, 3 Else ActiveSheet.PrintOut response, response End If End Sub "jaz" wrote: sheeloo i have people that dont know how to do that therefore i want it something else more flashy a pop up basically, that makes it easier for them once they click print object then they select 1,2,3, etc "Sheeloo" wrote: This option is already there in the Print option provided by Excel. See the 'Print Range' block... "jaz" wrote: i have a report sheet which includes 3 pages but not everybody needs 3 pages to print is there a code that once i click print then it would give me an option eg: please select an option 1. for 1st page 2. 2nd page 3. 3rd page 4. all the pages many thanks jez |
#8
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
how about just using this:
application.Dialogs(xlDialogPrint).Show -- Gary Excel 2003 "jez" wrote in message ... or can i have a button on the sheet with print icon? "Sheeloo" wrote: Try this macro Sub printPages() Dim response As Integer Dim msg As String msg = msg & "Please select an option: " & vbCrLf msg = msg & " 1. for 1st page: " & vbCrLf msg = msg & " 2. 2nd page: " & vbCrLf msg = msg & " 3. 3rd page: " & vbCrLf msg = msg & " 4. all the pages: " & vbCrLf response = Application.InputBox(msg) If (response < 1 And response < 2 And response < 3 _ And response < 4) Then MsgBox "Wrong Choice!" & vbCrLf & "Try again." Exit Sub End If If response = 4 Then ActiveSheet.PrintOut 1, 3 Else ActiveSheet.PrintOut response, response End If End Sub "jaz" wrote: sheeloo i have people that dont know how to do that therefore i want it something else more flashy a pop up basically, that makes it easier for them once they click print object then they select 1,2,3, etc "Sheeloo" wrote: This option is already there in the Print option provided by Excel. See the 'Print Range' block... "jaz" wrote: i have a report sheet which includes 3 pages but not everybody needs 3 pages to print is there a code that once i click print then it would give me an option eg: please select an option 1. for 1st page 2. 2nd page 3. 3rd page 4. all the pages many thanks jez |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
setting print ranges to print based on option | Excel Programming | |||
Y or N option to print 1 of 2 schedule | Excel Discussion (Misc queries) | |||
Print from Option Buttons | Excel Programming | |||
11 x 17 is not a print option for me | Excel Discussion (Misc queries) | |||
print option | Setting up and Configuration of Excel |