Logo 
Search:

MS Office Forum

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds

VB Printing

  Asked By: Cesar    Date: Oct 08    Category: MS Office    Views: 1013
  

Does anyone know how to do the following in VB Excel.
A single command button when pressed selects all 3 worksheets within a
spreadsheet and then displays the print menu? Or at least selects the 3
worksheets and prints out all the pre selected print areas?

Each time I attempt this I get an error even when all the correct printers are
attached.
Private sub commandbutton1_click()
worksheets (array(1,2,3)).select
worksheetss(1).activate
worksheets.printout
end sub

Hope this makes sense and can anyone help?

Share: 

 

2 Answers Found

 
Answer #1    Answered By: Freya Brown     Answered On: Oct 08

I tried ur code.It works. The only thing u have to correct  is the spelling
mistake in line 2. Change "worksheetss" to "worksheets".Hope thi sworks.

 
Answer #2    Answered By: Dep Tran     Answered On: Oct 08

but why do you need a macro for this? If the
print areas are set up in each sheet, then select Entire Workbook.

A macro to save doing that much mousing:

Sub PrntWb()
ActiveWorkbook.PrintOut Copies:=1, Collate:=True
End Sub

 
Didn't find what you were looking for? Find more on VB Printing Or get search suggestion and latest updates.




Tagged: