Results 1 to 4 of 4
  1. #1
    New Lounger
    Join Date
    Feb 2001
    Posts
    22
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Taking Control of Printing

    Hi

    I am trying to put a comment into a footer and then print the sheet. I can create and place the comment and print using a macro but I want this to happen when the user hits the normal print button not my macro button.
    In word I can use a FilePrint() macro to interupt normal printing but I can't find out how to do this in Excel
    I tried the beforeprint macro but it did not do anything

  2. #2
    Uranium Lounger
    Join Date
    Jan 2001
    Location
    South Carolina, USA
    Posts
    7,295
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Taking Control of Printing

    Using the BeforePrint event procedure is definitely the way to accomplish what you want to do. The BeforePrint event procedure must go in the Workbook module, it can't be put in a user module sheet. Open the workbook and press Alt+F11 to get into the VBA editor. In the project explorer, find your project and expand it until you find the ThisWorkbook object. Double click on ThisWorkbook to open the workbook code module. In the code window, the left dropdown list should have a Workbook item. Select the Workbook item. The right drop down list should now contain a list or event procedures for the workbook. Select BeforePrint from this list. Put your code in the procedure that displays in the editor.
    Legare Coleman

  3. #3
    New Lounger
    Join Date
    Feb 2001
    Posts
    22
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Taking Control of Printing

    Thanks for the advice
    I had put this on the worksheet1 object (in the VBA editor) the only sheet that gets printed. The help file which I had looked at did not make it clear where it needed to go.

  4. #4
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Salt Lake City, Utah, USA
    Posts
    9,508
    Thanks
    0
    Thanked 6 Times in 6 Posts

    Re: Taking Control of Printing

    Legare, my thanks also; as a VBA beginner, I didn't get what people were talking about with the "ThisWorkbook" object until I read your explanation and directions. Your continued clarity, thoroughness and concision is greatly appreciated.
    -John ... I float in liquid gardens
    UTC -7ąDS

Posting Permissions

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