ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Multiple Worksheets: Add:Print (https://www.excelbanter.com/excel-programming/315024-multiple-worksheets-add-print.html)

scorpion53061[_2_]

Multiple Worksheets: Add:Print
 
Hi I am looking for a link/tutorial on multiple worksheets, how to add them,
address them as needed and then to print them. UP till now I have only used
one worksheet in what I have built.



Tom Ogilvy

Multiple Worksheets: Add:Print
 
Dim sh as Worksheet
set sh = Worksheets.Add( After:=worksheets(worksheets.count))
sh.Name = "mysheet2"
With worksheets("mysheet2")
.Range("A1").Interior.Colorindex = 6
.Printout
End With

or
sh.Range("A1").Interior.ColorIndex = 6
sh.printout

to print 2 sheets

Worksheets(Array(1,2)).Printout

Worksheets(Array("Sheet1","mysheet2")).Printout

--
Regards,
Tom Ogilvy



"scorpion53061" wrote in message
...
Hi I am looking for a link/tutorial on multiple worksheets, how to add

them,
address them as needed and then to print them. UP till now I have only

used
one worksheet in what I have built.





Goppi[_2_]

Multiple Worksheets: Add:Print
 

... sounds like simple stuff - however I won't beable to recommend
specific tutorial, but I can give you some commands that will help yo
to start from :

to create a new sheet in the same workbook:
ActiveWorkbook.Sheets.Add Befo=Worksheets(Worksheets.Count)
set ws = ActiveSheet

to create a new workbook with just one sheet:
Set wb = Workbooks.Add (xlWBATWorksheet)

to print a Sheet
ActiveSheet.PrintOut
or
ws.PrintOut

cheers,
Pet

--
Gopp
-----------------------------------------------------------------------
Goppi's Profile: http://www.excelforum.com/member.php...fo&userid=1582
View this thread: http://www.excelforum.com/showthread.php?threadid=27314



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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com