![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Guest
Posts: n/a
|
I am usiing the Marco below to set the page orientation, gridlines and paper size. Is there a better way to do this? This seems to take a long time to run. Thanks
Sub setpage() With ActiveSheet.PageSetup '.LeftHeader = "" '.CenterHeader = "" '.RightHeader = "" '.LeftFooter = "" '.CenterFooter = "" '.RightFooter = "" '.LeftMargin = Application.InchesToPoints(0.75) '.RightMargin = Application.InchesToPoints(0.75) '.TopMargin = Application.InchesToPoints(1) '.BottomMargin = Application.InchesToPoints(1) '.HeaderMargin = Application.InchesToPoints(0.5) '.FooterMargin = Application.InchesToPoints(0.5) '.PrintHeadings = False .PrintGridlines = True '.PrintComments = xlPrintNoComments '.PrintQuality = 300 '.CenterHorizontally = False '.CenterVertically = False .Orientation = xlLandscape '.Draft = False .PaperSize = xlPaperLegal '.FirstPageNumber = xlAutomatic '.Order = xlDownThenOver '.BlackAndWhite = False '.Zoom = 100 End With 'ActiveWindow.SelectedSheets.PrintPreview End Sub |
|
|
|
#2 |
|
Board Regular
Join Date: Feb 2002
Posts: 3,064
|
Hi
Just a way can you not defaul Excel to these requirements and hit PRINT all ill done. or in VBA if you must ActiveSheet.PrintOut This will save the agro, or am i missing something?
__________________
Free Excel based Web Toolbar available here. Jack in the UK J & R Excel Solutions "making Excel work for you" |
|
|
|
|
|
#3 |
|
Guest
Posts: n/a
|
I am using it to set a sheet of filtered data, don't want to set it as a default
|
|
|
|
#4 |
|
Board Regular
Join Date: Feb 2002
Posts: 3,064
|
Tested your code took 1 or 2 seconds >>>>
I stilk with what isaid default and try . see if quicker, if networked can be slower lazer to fire and all the rest. the reason i suggested this is no one seems to know but Excel cant print as such, so tells windows to kick the print manager and so prints. Now even worse is evertime we prints Excel tell Windows and windows goes off checking drivers and them checks print mamagers request and them after a 3 cource dinner decids OK ill print, thus the loops, but take note thisis done ever time we print, i say why cant Windows remember???? save the checks. Now driver play the big part if slow a defaul print will test, is the same the printer config or driver might need updating, latist drivers are not always the best as we all know compatablity is the key. If networked, then send to another printer on VBA and default see if inprovements happen, thsi is called know testing... and so gives tangable guidlines. hope you get sucess.
__________________
Free Excel based Web Toolbar available here. Jack in the UK J & R Excel Solutions "making Excel work for you" |
|
|
|
|
|
#5 |
|
Join Date: Feb 2002
Posts: 12
|
Try this :-
Sub setpage() With ActiveSheet.PageSetup Application.ExecuteExcel4Macro ("PAGE.SETUP(,,,,,,,1,,,2,5)") End With End Sub |
|
|
|
|
|
#6 |
|
Guest
Posts: n/a
|
Very nice.
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|