Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 111
Default Printing a selected worksheet

I have multiple worksheets to select from, but the user will only need to
print one of those sheets. How can I in code through an input box function
ask the user to input the sheet name that is needed to be printed?

I have just checked for the last hour hunting for an answer, so sorry if
this question has been asked before.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,565
Default Printing a selected worksheet

prtFile = InputBox("Enter a file name (with/without extension?)", "FILE
NAME")
Workbooks(prtFile).PrintOut





"caldog" wrote in message
...
I have multiple worksheets to select from, but the user will only need to
print one of those sheets. How can I in code through an input box
function
ask the user to input the sheet name that is needed to be printed?

I have just checked for the last hour hunting for an answer, so sorry if
this question has been asked before.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default Printing a selected worksheet

Try

Sub Macro()
Dim strSheet As String
strSheet = InputBox("Enter sheet name to be printed")
ActiveWorkbook.Sheets(strSheet).PrintOut Copies:=1, Collate:=True
End Sub


Would suggest to have a userform with a combo box listing the sheet names...

--
Jacob


"caldog" wrote:

I have multiple worksheets to select from, but the user will only need to
print one of those sheets. How can I in code through an input box function
ask the user to input the sheet name that is needed to be printed?

I have just checked for the last hour hunting for an answer, so sorry if
this question has been asked before.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 111
Default Printing a selected worksheet

Thanks folks that worked just great

"Jacob Skaria" wrote:

Try

Sub Macro()
Dim strSheet As String
strSheet = InputBox("Enter sheet name to be printed")
ActiveWorkbook.Sheets(strSheet).PrintOut Copies:=1, Collate:=True
End Sub


Would suggest to have a userform with a combo box listing the sheet names...

--
Jacob


"caldog" wrote:

I have multiple worksheets to select from, but the user will only need to
print one of those sheets. How can I in code through an input box function
ask the user to input the sheet name that is needed to be printed?

I have just checked for the last hour hunting for an answer, so sorry if
this question has been asked before.

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
Printing selected columns on a worksheet Mike B Excel Discussion (Misc queries) 1 March 17th 09 05:00 PM
Printing selected area Nunya Excel Discussion (Misc queries) 1 February 6th 08 07:16 PM
printing selected pages in one worksheet while working in another BROCK8292 Excel Discussion (Misc queries) 0 March 9th 07 01:38 AM
Help printing selected rows kcowan Excel Discussion (Misc queries) 4 January 2nd 06 11:52 PM
Printing selected rows maacmaac Excel Discussion (Misc queries) 1 December 8th 05 05:15 PM


All times are GMT +1. The time now is 11:36 PM.

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"