Results 1 to 4 of 4
  1. #1
    Lounger
    Join Date
    Jun 2002
    Location
    RTP, NC, USA
    Posts
    40
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Moving a Macro (97)

    Is there any way to move a macro that I saved in my personal macro list to be associated with the worksheet that I created it for? I am leaving the department that I currently work for and don't want to re-record the macro that I created (and saved in my personal list) so that someone else can administer/use it.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Moving a Macro (97)

    Open the target worksheet.
    Activate the Visual Basic Editor (Tools/Macro/Visual Basic Editor or Alt+F11).
    Make sure the Project Explorer is visible (View/Project Explorer or Ctrl+R).
    Expand your Personal.xls. Expand Modules.
    Now you can drag any module to the target worksheet. When you drop it, it will be copied to the target worksheet.

    Another option is to export a module from Personal.xls and import it into the target worksheet. The export and import options are both in the File menu of the Visual Basic Editor.

  3. #3
    5 Star Lounger
    Join Date
    Jul 2002
    Location
    Toronto, Ontario, Canada
    Posts
    1,139
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Moving a Macro (97)

    Sure is a way to copy them.
    1. <LI>Open The workbook you want to copy the macro to
      <LI>Press Alt-F11 to get to the VBE
      <LI>Add a new Module to your Workbook you are taking with you and open it
      <LI>Expand VBAProject (PERSONAL.XLS)
      <LI>Expand Modules
      <LI>Open the module that has the macro you want to copy
      <LI>Select the macro and Copy it
      <LI>Switch back to the module you created in step 3 and paste
      <LI>Repeat for all the macros you want to copy
    If you want ALL the macros in a specific module, you can drag and drop the entire module from Personal.xls to the workbook you are taking.

    One final option and I guess the easiest way overall is to just take the entire personal.xls file with you. That way you don't forget something.
    --
    Bryan Carbonnell - Toronto <img src=/S/flags/Ontario.gif border=0 alt=Ontario width=30 height=18> <img src=/S/flags/Canada.gif border=0 alt=Canada width=30 height=18>
    Unfortunately common sense isn't so common!!
    Visit my website for useful Word, Excel and Access code, templates and Add-Ins

  4. #4
    Lounger
    Join Date
    Jun 2002
    Location
    RTP, NC, USA
    Posts
    40
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Moving a Macro (97)

    Thanks to the both of you...worked great

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •