LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,942
Default Print area - selection

hi,
try this.....
replace
ActiveSheet.Pagesetup.PrintArea = "$A$1:$H$27"
with
ActiveSheet.Pagesetup.PrintArea = Selection.address

but be careful about what you select. i suspect your margins might effect
what prints also.

Regards
FSt1

"al" wrote:

On Jan 13, 9:58 am, FSt1 wrote:
hi,
a recorded macro record all of your keyboard and mouse actions.
IF the recorded macro printed correctly when you recorded it, then it should
duplicate your action the next time.
could you be a bit more specific about what is not working?????

"al" wrote:
Macro below is not working properly for my selected cells(range/
region) - can someone help.thxs


Sub Printseuplandscape()
'
' Printseuplandscape Macro
' Macro recorded 12-01-2009 by Albert Ng
'


'
ActiveSheet.Pagesetup.PrintArea = ActiveRange
With ActiveSheet.Pagesetup
.PrintTitleRows = ""
.PrintTitleColumns = ""
End With
ActiveSheet.Pagesetup.PrintArea = "$A$1:$H$27"
With ActiveSheet.Pagesetup
.LeftHeader = ""
.CenterHeader = ""
.RightHeader = ""
.LeftFooter = "&D-&T"
.CenterFooter = "&P of &N"
.RightFooter = "&Z&F-&F-&A"
.LeftMargin = Application.InchesToPoints(0.25)
.RightMargin = Application.InchesToPoints(0.25)
.TopMargin = Application.InchesToPoints(0.85)
.BottomMargin = Application.InchesToPoints(0.85)
.HeaderMargin = Application.InchesToPoints(0.5)
.FooterMargin = Application.InchesToPoints(0.5)
.PrintHeadings = False
.PrintGridlines = True
.PrintComments = xlPrintNoComments
.PrintQuality = 600
.CenterHorizontally = False
.CenterVertically = False
.Orientation = xlLandscape
.Draft = False
.PaperSize = xlPaperA4
.FirstPageNumber = xlAutomatic
.Order = xlDownThenOver
.BlackAndWhite = True
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = False
.PrintErrors = xlPrintErrorsDisplayed
End With
End Sub


I would like to use the macro in my personal.xls macro - o that it
sets the page set up for the selected range

 
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
excel, worksheet, set print area, position selection on printed pa Eve Allen New Users to Excel 1 January 2nd 09 05:06 AM
Print Area Range Selection Emma Aumack Excel Programming 2 November 20th 08 06:32 PM
How do I clear a print area when the selection is grayed out? Ron Excel Discussion (Misc queries) 0 July 24th 07 11:28 PM
set print area based on selection crombes Excel Programming 0 November 2nd 05 07:15 PM
set print area based on selection crombes[_2_] Excel Programming 0 November 2nd 05 07:15 PM


All times are GMT +1. The time now is 07:34 AM.

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"