Hello
I have the following code in Sheet1:
and I have a button in a form, and when I click on it I want it to delete that Sub (the Some_Name()) entirely from Sheet1 VBE![]()
Please Login or Register to view this content.
What's the code for that?
Hello
I have the following code in Sheet1:
and I have a button in a form, and when I click on it I want it to delete that Sub (the Some_Name()) entirely from Sheet1 VBE![]()
Please Login or Register to view this content.
What's the code for that?
Good morning cgi_pro
I can sort out some code fot that for you. Before I do can you just confirm that the code is in Sheet1's module - not a regular code module? It makes a difference...
HTH
DominicB
Please familiarise yourself with the rules before posting. You can find them here.
Yes, it's in a sheet that I called (PlayersList) as its codename instead of the default Sheet1
Thank you in advance
Hi cgi_pro
OK, have a look at he code below :
You're going to have to set the relevant references for this to work : if you didn't have to do it after my last post to you, have a look here for a refresher :![]()
Please Login or Register to view this content.
http://www.excelforum.com/showthread.php?t=581170
Also you will need to keep the "trust access to visual basic project" box ticked.
HTH
DominicB
Thanks a lot dominicb
But can you please explain to me the following in the "ProcStartLine("Some_Name", vbext_pk_Proc)"
- What are you referring this "Some_Name" to? I mean what do I put in its place?
- What's that vbext_pk_Proc?
- What value does this ProcStartLine return? I believe the line number of rhtta procedure right?
Hi cgi_pro
Does the code not work or are you just dissecting to find out how it works? I wrote the routine for you based on the information you gave me. Some_Name is what you have inferred is the name of your routine in the above code, which I thought suspicious at the time - if your routine is realy caled "test"
then replace it with test.![]()
Please Login or Register to view this content.
vbext_pk_Proc is a VBA instruction from the VB Project Extensibility sub set (which is why you check the reference).
.ProcStartLine (and ProcCountLines) are commands to determine the start and lebgth of the code - you then delete starting from the startline for the number of lines.
HTH
DominicB
Thanks again dominicb
you're a good help![]()
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks