ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Right-Click Sheet, Move or Copy, & Class Module (https://www.excelbanter.com/excel-programming/392482-right-click-sheet-move-copy-class-module.html)

ryguy7272

Right-Click Sheet, Move or Copy, & Class Module
 
I created a template (1st workbook) with code, and then tried to copy it to a
workbook (2nd workbook) that has sheets that I want to analyze. I
right-clicked the sheet tab, and then left-clicked on €˜Move Selected Sheets
To Book and then clicked the check box that says €˜Create a Copy. I did
this a couple of times and it seemed like the analysis was done correctly on
the on the 2nd workbook. However, the code remains in the module of the 1st
workbook. Now, the macros dont seem to be working correctly, I guess
because all macros are still in the 1st workbook. I tried to copy/paste all
the code into a Class Module, and then I couldnt assign the control button
to the macro.

Confused? I am!! My questions are as follows: is there a way to get the
code to transfer to the 2nd workbook €˜Move or Copy & €˜Create a Copy
technique that I described above. Also, how do Class Modules work? Finally,
why cant I assign a control button to a class module?

TIA,
Ryan--

--
RyGuy

Tom Ogilvy

Right-Click Sheet, Move or Copy, & Class Module
 
Don't use a class module. It has nothing to do with what you are doing

http://www.cpearson.com/excel/vbe.htm

has the code to work with modules.

--
Regards,
Tom Ogilvy


"ryguy7272" wrote:

I created a template (1st workbook) with code, and then tried to copy it to a
workbook (2nd workbook) that has sheets that I want to analyze. I
right-clicked the sheet tab, and then left-clicked on €˜Move Selected Sheets
To Book and then clicked the check box that says €˜Create a Copy. I did
this a couple of times and it seemed like the analysis was done correctly on
the on the 2nd workbook. However, the code remains in the module of the 1st
workbook. Now, the macros dont seem to be working correctly, I guess
because all macros are still in the 1st workbook. I tried to copy/paste all
the code into a Class Module, and then I couldnt assign the control button
to the macro.

Confused? I am!! My questions are as follows: is there a way to get the
code to transfer to the 2nd workbook €˜Move or Copy & €˜Create a Copy
technique that I described above. Also, how do Class Modules work? Finally,
why cant I assign a control button to a class module?

TIA,
Ryan--

--
RyGuy



All times are GMT +1. The time now is 02:00 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com