Copy worksheet to new workbook question

G

Guest

Hi,
I have a worksheet that has code in the Worksheet_Change event. Through VBA,
I copy that worksheet to a new workbook. Once the Copy is complete, I would
like to delete the Worksheet_Change event code in the copied (new) worksheet.
Can this be done via VBA?
 
R

Ron de Bruin

Yes this is possible
Are you the only user of the code ?

let me know than I give you a good answer
 
G

Guest

Hi Ron,
Yes I am. The main workbook I created is a company budget with many columns
of data. The columns are hidden and unhidden based on code that fires on the
worksheet-change event. I have a macro that creates separate workbooks for
different departments within the company. Once the company budget is copied
to a new workbook, I hide rows and columns that do not pertain to that
department. Once the departmental workbooks are created, the row and column
presentation should be unchangable. I want to disable the worksheet_change
event code, so that the users of the departmental workbooks do not fire that
code that changes their departmetal presentation.

I hope this overview helps.
--
Thanks.
Chuck M.


Ron de Bruin said:
Yes this is possible
Are you the only user of the code ?

let me know than I give you a good answer
 
R

Ron de Bruin

See Chip's code then
http://www.cpearson.com/excel/vbe.aspx

The other option is to create a new workbook with one sheet and copy all the cells in
this worksheet

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


Chuck M said:
Hi Ron,
Yes I am. The main workbook I created is a company budget with many columns
of data. The columns are hidden and unhidden based on code that fires on the
worksheet-change event. I have a macro that creates separate workbooks for
different departments within the company. Once the company budget is copied
to a new workbook, I hide rows and columns that do not pertain to that
department. Once the departmental workbooks are created, the row and column
presentation should be unchangable. I want to disable the worksheet_change
event code, so that the users of the departmental workbooks do not fire that
code that changes their departmetal presentation.

I hope this overview helps.
 
G

Guest

Looks like Chip has the answer I was looking for.

Thanks for pointing me in that direction.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top