Is there a better way?
Prep for a pre-employment Excel test with Job Test Prep
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 6 of 6

Thread: Is there a better way?

  1. #1
    Guest

    Default

     
    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. #2
    Board Regular
    Join Date
    Feb 2002
    Posts
    3,169
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    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. #3
    Guest

    Default

    I am using it to set a sheet of filtered data, don't want to set it as a default

  4. #4
    Board Regular
    Join Date
    Feb 2002
    Posts
    3,169
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    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. #5

    Join Date
    Feb 2002
    Posts
    12
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Try this :-

    Sub setpage()
    With ActiveSheet.PageSetup
    Application.ExecuteExcel4Macro ("PAGE.SETUP(,,,,,,,1,,,2,5)")
    End With
    End Sub

  6. #6
    Guest

    Default

      
    Very nice.

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

 

 
DMCA.com