+ Reply to Thread
Results 1 to 5 of 5

Apply same formatting to all worksheets in a workbook

  1. #1
    Registered User
    Join Date
    06-04-2007
    MS-Off Ver
    Excel 2007
    Posts
    94

    Apply same formatting to all worksheets in a workbook

    I have this macro that is designed to reformat the first sheet in a workbook, however now the workbook can contain any number of additional sheets that all need the same formatting. What is the proper way to change this from referring to just the first sheet in the workbook but instead to all the sheets in the workbook.



    Please Login or Register  to view this content.
    Last edited by capnhud; 06-22-2010 at 12:24 PM.

  2. #2
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,964

    Re: Apply same formatting to all worksheets in a workbook

    Something like this?

    Please Login or Register  to view this content.
    Martin

    If my solution has saved you time and/or money, please consider sponsoring my run in the 2020 London Marathon in aid of Cancer Research UK.

    https://uk.virginmoneygiving.com/MartinRice

  3. #3
    Registered User
    Join Date
    06-04-2007
    MS-Off Ver
    Excel 2007
    Posts
    94

    Re: Apply same formatting to all worksheets in a workbook

    it appears with this change everything is done to only one sheet and the effect is cumulative meaning what was supposed to be done on all the sheets is now just done on just one as many times as there are sheets.


    This is the macro that consolidates the workbooks

    Please Login or Register  to view this content.

    in this code:
    Please Login or Register  to view this content.



    and then what you posted would be done one the workbook that has the sheets merged to it.

    Attached are sample files.
    Attached Files Attached Files
    Last edited by capnhud; 06-21-2010 at 03:40 PM.

  4. #4
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,964

    Re: Apply same formatting to all worksheets in a workbook

    Try

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    06-04-2007
    MS-Off Ver
    Excel 2007
    Posts
    94

    Re: Apply same formatting to all worksheets in a workbook

    I was able to find out that what I needed was something along the lines of this code:

    Please Login or Register  to view this content.

+ 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