+ Reply to Thread
Results 1 to 2 of 2

macro to print a sheet if a cell is a certain value

  1. #1
    John Davies
    Guest

    macro to print a sheet if a cell is a certain value

    I have set up the following macro to print certain sheets and it works ok,
    however I only want it to print sheet named 'Handback' if cell A1 in that
    sheet is greater than 1. How can I incorporate that in the macro?

    Thanks in advance of any help.

    Regards

    John


    Sub newprint()
    '
    ' newprint Macro
    ' Macro recorded 08/02/2006 by
    '

    '
    ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
    Sheets("Customer Profile").Select
    Range("b15") = "NEW VEHICLE ENQUIRY"
    Sheets("DAN").Select
    ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
    Sheets("Customer Profile").Select
    ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
    Sheets("Checklist").Select
    ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
    Sheets("Handback").Select
    ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
    Sheets("New").Select
    Range("M46") = "CUSTOMER COPY"
    ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
    Range("M46").Select
    Selection.ClearContents
    Sheets("DAN").Select
    Range("Z70") = "CUSTOMER COPY"
    ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
    Range("Z70").Select
    Selection.ClearContents
    Sheets("Disclosure").Select
    ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
    Sheets("AA Cars").Select
    ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
    Sheets("New").Select
    Range("G10").Select

  2. #2
    Tom Ogilvy
    Guest

    RE: macro to print a sheet if a cell is a certain value

    Sheets("Handback").Select
    if Range("A1") > 1 then
    ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
    End if

    --
    Regards,
    Tom Ogilvy


    "John Davies" wrote:

    > I have set up the following macro to print certain sheets and it works ok,
    > however I only want it to print sheet named 'Handback' if cell A1 in that
    > sheet is greater than 1. How can I incorporate that in the macro?
    >
    > Thanks in advance of any help.
    >
    > Regards
    >
    > John
    >
    >
    > Sub newprint()
    > '
    > ' newprint Macro
    > ' Macro recorded 08/02/2006 by
    > '
    >
    > '
    > ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
    > Sheets("Customer Profile").Select
    > Range("b15") = "NEW VEHICLE ENQUIRY"
    > Sheets("DAN").Select
    > ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
    > Sheets("Customer Profile").Select
    > ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
    > Sheets("Checklist").Select
    > ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
    > Sheets("Handback").Select
    > ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
    > Sheets("New").Select
    > Range("M46") = "CUSTOMER COPY"
    > ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
    > Range("M46").Select
    > Selection.ClearContents
    > Sheets("DAN").Select
    > Range("Z70") = "CUSTOMER COPY"
    > ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
    > Range("Z70").Select
    > Selection.ClearContents
    > Sheets("Disclosure").Select
    > ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
    > Sheets("AA Cars").Select
    > ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
    > Sheets("New").Select
    > Range("G10").Select


+ Reply to Thread

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