+ Reply to Thread
Results 1 to 7 of 7

Formatting Macro for New Workbook

  1. #1
    Registered User
    Join Date
    12-02-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    11

    Formatting Macro for New Workbook

    I receive a daily data dump every morning from our billing team that contains all clients that were invoiced/printed the prior day). It comes in the form of a new workbook. I have a macro that formats the data to my liking.

    What is the best way of executing this macro every time I receive the new worksheet? I currently have the code saved in a .txt, open up VBA, insert a new module, copy paste, then run the macro.

    Must be an easier way.


    Thanks guys!

  2. #2
    Registered User
    Join Date
    11-06-2013
    Location
    Prudhoe Bay, AK
    MS-Off Ver
    Excel 2010
    Posts
    17

    Re: Formatting Macro for New Workbook

    Create your own template. Set it up with your VBA and test it by copying and pasting the sheet(s) you'll be running the macro on. Whenever you get a new data dump, copy and paste it into your template, run your macro, and "Save As" that days date. Then you'll always have your unmodified template ready for the next days data dump.

  3. #3
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Formatting Macro for New Workbook

    Hi,

    Why not just put the VBA macro code in a module in your Personal.xlsm workbook and run the macro from there?
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  4. #4
    Registered User
    Join Date
    12-02-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    11

    Re: Formatting Macro for New Workbook

    Quote Originally Posted by Richard Buttrey View Post
    Hi,

    Why not just put the VBA macro code in a module in your Personal.xlsm workbook and run the macro from there?
    Hi. So you mean having a separate workbook named Personal.xlsm, opening it up (everyday?), and having my data dump workbook run the macro from Personal.xlsm?

    Sorry, I'm just getting into VBA / macros.

    Thanks.

  5. #5
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Formatting Macro for New Workbook

    Hi,

    It's even easier than that. The Personal Workbook (once it's been set up) will open automatically every time you open the Excel Application.

    To start the Personal workbook just start recording any simple macro and choose to save it in the Personal Macro Workbook. Once that's been set up you can delete the macro in the VBE where you'll find the Personal.xlsb workbook listed and from now on it will always be present without you needing to do anything.

    Here's an article about it.

    http://office.microsoft.com/en-gb/ex...102174076.aspx

  6. #6
    Registered User
    Join Date
    12-02-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    11

    Re: Formatting Macro for New Workbook

    I'll look at it today. Thanks

  7. #7
    Registered User
    Join Date
    12-02-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    11

    Re: Formatting Macro for New Workbook

    Solved thanks! Never knew about the .xlsb hidden book.

    Thanks guys.

+ 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. [SOLVED] Save the split the workbook file type as Excel Binary Workbook From Run Macro
    By breadwinner in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-25-2013, 05:09 AM
  2. Macro for formatting fonts and cell colours - not Conditional Formatting
    By Kayaness in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-07-2011, 03:46 AM
  3. Pivot Table graph looses formatting after running formatting macro
    By arthurbr in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-27-2011, 04:16 AM
  4. Macro to create new workbook and save it after formatting
    By vijanand1279 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-25-2011, 07:13 AM
  5. VB Macro - Formatting from another workbook
    By Petitboeuf in forum Excel General
    Replies: 0
    Last Post: 05-19-2005, 06:17 AM

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