By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,986 Members | 1,487 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,986 IT Pros & Developers. It's quick & easy.

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

P: 3
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
Share this Question
Share on Google+
3 Replies


P: 3
SAH
I still need help with this please.
Nov 23 '06 #2

100+
P: 267
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

P: 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.