+ Reply to Thread
Results 1 to 5 of 5

Macro to format all worksheets and then print workbook

  1. #1
    Registered User
    Join Date
    07-25-2013
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    88

    Macro to format all worksheets and then print workbook

    Hi all,

    I receive a workbook every day that has approximately 30 worksheets in it. Each worksheet has the same columns headings in A through K. Column A lists an account number, and the remaining columns contain additional information about the account.

    On some days, a worksheet may simply contain one or two account numbers. On other days, there may be 30 or 40 rows of data.

    I want to create a macro that I can store in my personal workbook that will autofit columns and resize the print area for each worksheet to one page. Basically, I want to print each worksheet onto one piece of paper - if there are more rows of data, the font can be reduced so everything will fit on one page. I then want the macro to print each worksheet within the workbook.

    Can anyone advise on how I might create this macro?

    For each worksheet in the workbook:

    1. Autofit columns
    2. Set print area to one page
    3. Print worksheet

    Any suggestions/advice are greatly appreciated. Thanks for reading.

    -Student1990

  2. #2
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Macro to format all worksheets and then print workbook

    I would suggest recording a macro to set-up the format you want for one page. Then we can easily help to modify it for the entire workbook.

  3. #3
    Registered User
    Join Date
    07-25-2013
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    88

    Re: Macro to format all worksheets and then print workbook

    Hi John,

    I recorded a sample of what I'd like to do to each worksheet in the workbook. Is there a way to modify this so it will apply to every single worksheet in the workbook? Thanks for your help!

    Please Login or Register  to view this content.

  4. #4
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Macro to format all worksheets and then print workbook

    Maybe:

    Please Login or Register  to view this content.

  5. #5
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: Macro to format all worksheets and then print workbook

    Hi, Student1990,

    no need for activating each single sheet or going through each column there on itīs own for using AutoFit:
    Please Login or Register  to view this content.
    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Macro Applying Print Fit to One Page on All Worksheets in Workbook
    By brokbird in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-24-2013, 09:13 PM
  2. Print checked worksheets with sheets own print macro
    By nigelog in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-22-2013, 10:35 AM
  3. Replies: 8
    Last Post: 04-21-2013, 01:58 AM
  4. Print worksheets Workbook
    By marreco in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 03-16-2012, 03:25 PM
  5. Replies: 1
    Last Post: 10-27-2005, 06:00 PM

Tags for this Thread

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