+ Reply to Thread
Results 1 to 5 of 5

VBA Script to run from separate file instead of current excel workbook

  1. #1
    Registered User
    Join Date
    02-11-2013
    Location
    eugene, or
    MS-Off Ver
    Excel 2011
    Posts
    74

    VBA Script to run from separate file instead of current excel workbook

    I currently have a bit of code that is written and working just the way I want it to. This code resides in a workbook called "timeclock codes" the VBA extracts data from this workbook another workbook called "quickbooks file", dumps it into a worksheet and saves it. What I would like is to have a workbook called MACRO or something along those lines that would have the code, this way an employee could open the generated "timeclock codes" file and "quickbooks file", and the macro file, preferably with a button that simply says "Run Macro" and does what I wrote it to do.

    I feel like this should be a set of simple changes, but I have been learning as I go, and receiving a lot of help, and am not sure I know how to do this....
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: VBA Script to run from separate file instead of current excel workbook

    Hi

    Are you aware that each user has a personal workbook that is opened whenever they run excel?

    This is normally hidden.

    But you can record a macro to this workbook.

    open excel

    unhide the personal workbook

    Open visual basic

    paste your macro into a module in the personal workbook ( view project explore will show you what modules are available. Insert new module if none exist)
    hide personal workbook

    Quit excel making sure to save changes to personal workbook when asked by excel.

  3. #3
    Registered User
    Join Date
    02-11-2013
    Location
    eugene, or
    MS-Off Ver
    Excel 2011
    Posts
    74

    Re: VBA Script to run from separate file instead of current excel workbook

    I could be wrong, but would the code not still need to be modified?

  4. #4
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: VBA Script to run from separate file instead of current excel workbook

    Do you need help amending it?

    I assumed that you had written the code.

  5. #5
    Registered User
    Join Date
    02-11-2013
    Location
    eugene, or
    MS-Off Ver
    Excel 2011
    Posts
    74

    Re: VBA Script to run from separate file instead of current excel workbook

    Nope, a few minor tweaks and it worked great! Thank you, I had NO idea this existed!

+ 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