Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VBA Macros to follow Excel worksheet being moved from workbook?

Status
Not open for further replies.

RyanScharfy

Technical User
Jun 17, 2003
86
US
I have some macros that play with the page breaks and column groupings. They are associated with some radial buttons on a worksheet.

I can move that worksheet out of the workbook but the macros are then lost.

Any easy fix for this?


 



Copy the macro code to the worksheet object of the sheet you are moving out of the workbook.

Or with the original workbook open along with the NEW workbook containing your sheet, drag the module containing the code to the other workbook in the VBA Project Explorer (ctr+R to VIEW)

Skip,

[glasses] [red][/red]
[tongue]
 
Skip,

Can I throw a curve ball here? The worksheet is moved as part of the instructions of a macro. Users wil press a button and "voila" they get the report. The users won't know how nor will want to manually do it.

That being said, I hope I'm not completely out of luck. Any idea? Is it possible to write a macro that "writes a macro"? I suppose anything's possible, but can get complicated. If you could point me in the right direction, it might help. Thanks.
 
Skips first suggestion will make the code move with the worksheet.


Gavin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top