+ Reply to Thread
Results 1 to 7 of 7

Macro to write a macro on a different Workbook?

  1. #1
    Registered User
    Join Date
    06-05-2008
    Posts
    84

    Macro to write a macro on a different Workbook?

    I need a way to write (or copy) a macro from one sheet to another.

    I have a sheet coming out of Access. So what I have is a "blank XLS" workbook that goes and grabs the other workbook (one that Access exported) and does some formats and creates some drop downs.


    Now I need it to add the Calendar macro (so when a cell is picked the calendar pops up and allows you to choose)




    If there is a better way to do this PLEASE let me know.




    Is there a way at all?

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    It's much easier to create an addin to hold the code, this would then be available to all workbooks
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Registered User
    Join Date
    06-05-2008
    Posts
    84
    Is that possible when all of the sheets are exported from Access. At that point all of the XLS sheets are blank correct?

    That is why I had a separate workbook doing all of the dropdowns and formatting. (there could be up to 200 workbooks to do this on)



    Thanks for the quick reply Roy..

  4. #4
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Shouldn't the code be in blank.xls?

  5. #5
    Registered User
    Join Date
    06-05-2008
    Posts
    84
    Yes the macros are in a Blank sheet.

    Then Access to a XLS sheet (this one is a new one without any macros, or anything like that)

    Then the "Blank Sheet" (With the macros runs, opens the file that Access just exported and Formats, and creates the dropdowns) I would also like this calendar option in as well.. Just not sure how to get it there.

    Thanks

  6. #6
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Create a template file with all the formatting & code in. See

    http://www.excel-it.com/excel_templates.htm

  7. #7
    Registered User
    Join Date
    06-05-2008
    Posts
    84
    I just read through that and I really don't see where it will help me. What does that do differently then a regular XLS that runs macros on a different sheet.

    please explain.

+ 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