467,161 Members | 900 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,161 developers. It's quick & easy.

Using vb macro to delete a Command Button and it's code in Excel

This code:-

Expand|Select|Wrap|Line Numbers
  1. ActiveSheet.Shapes("CommandButton1").Delete
Gets rid of the Button OK but it leaves the Code in the Command Buttton1_Click Subroutine and I should like to clear that too.
Can I do that in the vb macro?
Nov 21 '06 #1
  • viewed: 3754
Share:
3 Replies
SAH
I still need help with this please.
Nov 23 '06 #2
100+
I still need help with this please.
hi

don't think you can change the macro in run-time
guess you're stuck here.
Nov 23 '06 #3
SAH
OK. Thanks anyway.
I guess it is not a big deal but if the macro security is on then when you open the sheet, the deleted button appears until you accept or decline the macro function. Then it disappears. Not vital but it is a bit untidy!

Thanks again,
Simon
Nov 23 '06 #4

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

2 posts views Thread by meganrobertson22@hotmail.com | last post: by
14 posts views Thread by pmud | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.