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!

Variable Print Area 1

Status
Not open for further replies.

SgtPepps

IS-IT--Management
May 1, 2002
109
GB
I need to set the Print area to a selection of cells but the selection will be different every time. Is there a way of setting the Print area to the current selection?

Regards

Sgtpepps
 
Yup:
ActiveSheet.PageSetup.PrintArea = Selection.Address

if you are manually selecting the range to print
or:
LRow = range("A65536").end(xlup).row
LCol - rnage("IV1").end(xltoleft).column
Activesheet.pagesetup.printarea = range(cells(1,1),cells(LRow,LCol))

If you just want to sleect the whole range of used data

HTH
Geoff
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top