Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Can't find my VBA code
I added a button, btnPrint, to my spreadsheet, and wrote some code. The
next day, I wanted to make changes to the code, and I could not find it. I was able to open the VBA window, but the code was not there, nor did I see any reference to btnPrint. The button works, so the code must be in there somewhere. How do I get to it? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Can't find my VBA code
If it is a control button Right Click on the button and then select view
Code. You may have to click on the Design button first in order to allow you to right click on it. If it is a form and not a control button, then right click on it and select assign macro, then select edit or step in. -- If this posting was helpful, please click on the Yes button. Regards, Michael Arch. "Bev Kaufman" wrote: I added a button, btnPrint, to my spreadsheet, and wrote some code. The next day, I wanted to make changes to the code, and I could not find it. I was able to open the VBA window, but the code was not there, nor did I see any reference to btnPrint. The button works, so the code must be in there somewhere. How do I get to it? |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Can't find my VBA code
I did right click on the button and then press the View Code button. This
brought up the VBA code window, but the code was not there. I could see the four sheets plus another called This Worksheet, but there was no code for btnPrint, nor was that control - or any control - visible in any of the dropdowns. I am certain that this was not a macro I created, which I believe involves the recording of key strokes. I used the Printout command. BTW, this is an old version of Excel, 2000. If that has anything to do with the problem. "Michael" wrote: If it is a control button Right Click on the button and then select view Code. You may have to click on the Design button first in order to allow you to right click on it. If it is a form and not a control button, then right click on it and select assign macro, then select edit or step in. -- If this posting was helpful, please click on the Yes button. Regards, Michael Arch. "Bev Kaufman" wrote: I added a button, btnPrint, to my spreadsheet, and wrote some code. The next day, I wanted to make changes to the code, and I could not find it. I was able to open the VBA window, but the code was not there, nor did I see any reference to btnPrint. The button works, so the code must be in there somewhere. How do I get to it? |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Can't find my VBA code
Try this:
In the VBA code Window from the Main Menu Click on View - Object Browser and on the pop up window where it reads All Libraries Select the Name of the project you are working on(this could be your file Name) and on the left bottom section you will see the classes, click on the class that shows the sheet name where you placed the button, and on your right you will see the Members of that Class your code should be listed there under btnPrint or check all of those that have a green icon on them. Hope this helps. -- If this posting was helpful, please click on the Yes button. Regards, Michael Arch. "Bev Kaufman" wrote: I did right click on the button and then press the View Code button. This brought up the VBA code window, but the code was not there. I could see the four sheets plus another called This Worksheet, but there was no code for btnPrint, nor was that control - or any control - visible in any of the dropdowns. I am certain that this was not a macro I created, which I believe involves the recording of key strokes. I used the Printout command. BTW, this is an old version of Excel, 2000. If that has anything to do with the problem. "Michael" wrote: If it is a control button Right Click on the button and then select view Code. You may have to click on the Design button first in order to allow you to right click on it. If it is a form and not a control button, then right click on it and select assign macro, then select edit or step in. -- If this posting was helpful, please click on the Yes button. Regards, Michael Arch. "Bev Kaufman" wrote: I added a button, btnPrint, to my spreadsheet, and wrote some code. The next day, I wanted to make changes to the code, and I could not find it. I was able to open the VBA window, but the code was not there, nor did I see any reference to btnPrint. The button works, so the code must be in there somewhere. How do I get to it? |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Can't find my VBA code
That did the trick. Thank you
"Michael" wrote: Try this: In the VBA code Window from the Main Menu Click on View - Object Browser and on the pop up window where it reads All Libraries Select the Name of the project you are working on(this could be your file Name) and on the left bottom section you will see the classes, click on the class that shows the sheet name where you placed the button, and on your right you will see the Members of that Class your code should be listed there under btnPrint or check all of those that have a green icon on them. Hope this helps. -- If this posting was helpful, please click on the Yes button. Regards, Michael Arch. "Bev Kaufman" wrote: I did right click on the button and then press the View Code button. This brought up the VBA code window, but the code was not there. I could see the four sheets plus another called This Worksheet, but there was no code for btnPrint, nor was that control - or any control - visible in any of the dropdowns. I am certain that this was not a macro I created, which I believe involves the recording of key strokes. I used the Printout command. BTW, this is an old version of Excel, 2000. If that has anything to do with the problem. "Michael" wrote: If it is a control button Right Click on the button and then select view Code. You may have to click on the Design button first in order to allow you to right click on it. If it is a form and not a control button, then right click on it and select assign macro, then select edit or step in. -- If this posting was helpful, please click on the Yes button. Regards, Michael Arch. "Bev Kaufman" wrote: I added a button, btnPrint, to my spreadsheet, and wrote some code. The next day, I wanted to make changes to the code, and I could not find it. I was able to open the VBA window, but the code was not there, nor did I see any reference to btnPrint. The button works, so the code must be in there somewhere. How do I get to it? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Find last row code | Excel Discussion (Misc queries) | |||
Find Code Needs Help | Excel Programming | |||
cannot find code | Excel Programming | |||
VBA code 'find next' | Excel Programming | |||
VBA Code to FIND | Excel Programming |