Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Selecting range for printing in excel 2

Status
Not open for further replies.

TRHorn

Technical User
Feb 21, 2010
24
US
I want to print certain tabs by pressing a button. I used a counter to find where each tab ends and now I'm trying to select the range.

How do you select ranges? is it worksheet.select.range? I also don't know the print commands to use do I call the sheet and then print it?
 
A starting point:
Code:
' Select multiple tabs (2,3,4):
Sheets(Array("Sheet2", "Sheet3", "Sheet4")).Select

' Print selected sheets:
ActiveWindow.SelectedSheets.PrintOut

' Print desired tabs without selection:
Sheets(Array("Sheet2", "Sheet3", "Sheet4")).PrintOut

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Thats a start. But I want to select certain parts of each sheet.
 
Sheets("Sheetname").Range("A" & startrow & ":Z" & lRow).select

OR

Sheets("Sheetname").Range(cells(startrow,1),cells(endRow,26)).select


where startrow and endrow are variables that define the top and bottom rows of your range



Rgds, Geoff

We could learn a lot from crayons. Some are sharp, some are pretty and some are dull. Some have weird names and all are different colours but they all live in the same box.

Please read FAQ222-2244 before you ask a question
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top