Results 1 to 5 of 5

Print with Macro

Threaded View

  1. #1
    Registered User
    Join Date
    07-08-2010
    Location
    Singapore
    MS-Off Ver
    Excel 2003
    Posts
    3

    Print with Macro

    Hi,

    Newbie at macro here..help!!

    How do you do conditional printing of worksheets for macro (using recorded macro)?
    Bacially I have to print for A-E(total of 5) under heading (cell D161).
    Sometimes, I do not need to print for all 5 as there maybe only information for A-B and E,
    no information for C and D.

    Hence I should do a for or if/else loop to run?
    What is e proper syntax?
    Thanks.

    Below is a sample of my recorded macro.
        Selection.AutoFilter Field:=4, Criteria1:="A"
        Range("D161").Select
        ActiveWindow.View = xlPageBreakPreview
        ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
        ActiveWindow.View = xlNormalView
        Selection.AutoFilter Field:=4, Criteria1:="B"
        ActiveWindow.View = xlPageBreakPreview
        ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
        Selection.AutoFilter Field:=4, Criteria1:="C"
        ActiveWindow.View = xlPageBreakPreview
        ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
        Selection.AutoFilter Field:=4, Criteria1:="D"
        ActiveWindow.View = xlPageBreakPreview
        ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
        Selection.AutoFilter Field:=4, Criteria1:="E"
        ActiveWindow.View = xlPageBreakPreview
        ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
    Last edited by Leith Ross; 07-08-2010 at 02:40 PM. Reason: Added Code Tags

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1