Copy Macro and Forms/code

  • Thread starter Thread starter anon1m0us
  • Start date Start date
A

anon1m0us

Hi; I created a macro and userforms on an excel spreadsheet. I want to
copy everything (userforms, code, macros) to a new spreadhseet. How
can I do it?
 
I want to move all the code and macro's (I do not need any data in the
cells copied) to a new spreadsheet that contains the good data. The
current spreadhseet is going to be deleted. This is a one time process.
 
all you have to do is:

1. open the workbook that contains all the macros & userforms.
2. open a new workbook
3. open the VBA editor - you will see BOTH workbooks there
4. select & drag each module & userform from the old workbook to the
new workbook (will copy).
5. highlight, copy, & paste any worksheet or workbook macros that
aren't in a module.

:)
susan
 
I copied the forms and module over. But it still does not work. When i
click on cell A2, a form is supposed to pop up. It is not happening.
 
Maybe the Macro is not running?
anon1m0us said:
I copied the forms and module over. But it still does not work. When i
click on cell A2, a form is supposed to pop up. It is not happening.
 
Ok, I copied the good data in the Workbook that i need, instead of
taking the MAcro out. However, there seems to be an extra workbook
called Personel.xls which opens everytime I open the workbook. Any
idea why and where it comes from?
 
perhaps the code from the OLD workbook referred to certain sheet names
that are different in the new workbook???

look for anything that says something like

..worksheet("xxxx")

and make sure the xx's are the names of your CURRENT workbook
worksheets.

hth
susan
 
also, if you're supposed to click on a certain cell, make sure the
WORKSHEET code behind the original worksheet was copied over to the
new worksheed (you'd have to do this manually - #5 in my original
directions). there must be a _selection or _change code behind that
worksheet that calls the userform.
susan
 
the personal.xls is a hidden worksheet which contains any macros that
you want available to run on any worksheet. it's stored in book1.
you can see it in the vba editor. but those macros will always be
there, no matter what worksheet you open, so you shouldn't need to
copy any of them to the new workbook.

if you record a macro, it asks you if you want it to be stored in THAT
particular workbook (would only be able to be accessed when that
workbook is open) or if you want it stored in the PERSONAL workbook
(which would always be available).
:)
susan
 
Back
Top