Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 45
Default Remove VB code from a sheet

I have a few comboboxes on a worksheet and when the user saves the worksheet,
a macro removes all the comboboxes. I was digging through the forum to find a
way to eliminate the code from a worksheet, but I read a post that said it
couldn't be done.

Is that true? If it is not true, where can I find code to eliminate code?

Thanks.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Remove VB code from a sheet

Hi IT_Roofer,

See Chip Pearson at:

Programming To The Visual Basic Editor
http://www.cpearson.com/excel/vbe.htm

See particularly the section entitled:

Deleting A Module From A Workbook

but do read Chip's page introduction in full!



---
Regards,
Norman


"IT_roofer" wrote in message
...
I have a few comboboxes on a worksheet and when the user saves the
worksheet,
a macro removes all the comboboxes. I was digging through the forum to
find a
way to eliminate the code from a worksheet, but I read a post that said it
couldn't be done.

Is that true? If it is not true, where can I find code to eliminate code?

Thanks.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 45
Default Remove VB code from a sheet

Thank you for your reply. I will dig around on Chip's website, but initially,
the page you pointed me to is not the information I want to find. That page
refers to removing/adding code to a MODULE - I want to remove code from a
WORKSHEET.

Explaination:
I have code in the worksheet that monitor calculations and changes to
certain values and comboboxes and when the sheet is "saved", it is copied to
a new workbook and controls are removed. Well now I would like to apply one
more bit of code to remove the worksheet code when it is copied into the new
workbook.

"Norman Jones" wrote:

Hi IT_Roofer,

See Chip Pearson at:

Programming To The Visual Basic Editor
http://www.cpearson.com/excel/vbe.htm

See particularly the section entitled:

Deleting A Module From A Workbook

but do read Chip's page introduction in full!



---
Regards,
Norman


"IT_roofer" wrote in message
...
I have a few comboboxes on a worksheet and when the user saves the
worksheet,
a macro removes all the comboboxes. I was digging through the forum to
find a
way to eliminate the code from a worksheet, but I read a post that said it
couldn't be done.

Is that true? If it is not true, where can I find code to eliminate code?

Thanks.




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Remove VB code from a sheet

You can remove the code from a sheet module with code like the following. It
will remove the code behind MySheet.

With ThisWorkbook
With .VBProject.VBComponents(.Worksheets("MySheet").Cod eName).CodeModule
.DeleteLines 1, .CountOfLines
End With
End With


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting LLC
www.cpearson.com
(email on the web site)


"IT_roofer" wrote in message
...
Thank you for your reply. I will dig around on Chip's website, but
initially,
the page you pointed me to is not the information I want to find. That
page
refers to removing/adding code to a MODULE - I want to remove code from a
WORKSHEET.

Explaination:
I have code in the worksheet that monitor calculations and changes to
certain values and comboboxes and when the sheet is "saved", it is copied
to
a new workbook and controls are removed. Well now I would like to apply
one
more bit of code to remove the worksheet code when it is copied into the
new
workbook.

"Norman Jones" wrote:

Hi IT_Roofer,

See Chip Pearson at:

Programming To The Visual Basic Editor
http://www.cpearson.com/excel/vbe.htm

See particularly the section entitled:

Deleting A Module From A Workbook

but do read Chip's page introduction in full!



---
Regards,
Norman


"IT_roofer" wrote in message
...
I have a few comboboxes on a worksheet and when the user saves the
worksheet,
a macro removes all the comboboxes. I was digging through the forum to
find a
way to eliminate the code from a worksheet, but I read a post that said
it
couldn't be done.

Is that true? If it is not true, where can I find code to eliminate
code?

Thanks.






  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 45
Default Remove VB code from a sheet

Ignore my other post.

I glanced over it and, of course, as soon as I dug into it like I said I was
going to, I now have to eat my words.

Thanks again, Norman.

"Norman Jones" wrote:

Hi IT_Roofer,

See Chip Pearson at:

Programming To The Visual Basic Editor
http://www.cpearson.com/excel/vbe.htm

See particularly the section entitled:

Deleting A Module From A Workbook

but do read Chip's page introduction in full!



---
Regards,
Norman


"IT_roofer" wrote in message
...
I have a few comboboxes on a worksheet and when the user saves the
worksheet,
a macro removes all the comboboxes. I was digging through the forum to
find a
way to eliminate the code from a worksheet, but I read a post that said it
couldn't be done.

Is that true? If it is not true, where can I find code to eliminate code?

Thanks.






Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
copied from web page to excel sheet and cant remove from sheet mitch Excel Worksheet Functions 2 May 4th 10 07:58 PM
copied from web page to excel sheet and cant remove from sheet mitch Excel Worksheet Functions 0 May 4th 10 05:38 PM
Inserting a row in sheet A should Insert a row in sheet B, removing a row in Sheet A should remove the corresponding row in sheet B Hannes Heckner Excel Programming 1 March 5th 04 09:10 AM
Use VB code to remove code in sheet1 WashoeJeff Excel Programming 4 January 25th 04 12:23 AM
Remove VBA code Michi[_2_] Excel Programming 3 January 21st 04 04:18 PM


All times are GMT +1. The time now is 03:54 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"