Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello
I have created a Button on a worksheet called Button1 To test it before going any further, since I am so new, I have entered this code in the worksheet Private Sub Button1_Click() MsgBox "you clicked here" End Sub An error message keeps coming up saying: "The macro 'Project.xls!Button1_Click' cannot be found. What am I missing? David |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
David,
Not sure about this but are you sure the button is named "Button1" and not "CommandButton1"? "David" wrote: Hello I have created a Button on a worksheet called Button1 To test it before going any further, since I am so new, I have entered this code in the worksheet Private Sub Button1_Click() MsgBox "you clicked here" End Sub An error message keeps coming up saying: "The macro 'Project.xls!Button1_Click' cannot be found. What am I missing? David |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Put it in a standard code module, not in the worksheet code module.
-- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "David" wrote in message ... Hello I have created a Button on a worksheet called Button1 To test it before going any further, since I am so new, I have entered this code in the worksheet Private Sub Button1_Click() MsgBox "you clicked here" End Sub An error message keeps coming up saying: "The macro 'Project.xls!Button1_Click' cannot be found. What am I missing? David |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks Bob
Why is it that I need to do that? I am used to working with Access where I put all the code into the form. "Bob Phillips" wrote: Put it in a standard code module, not in the worksheet code module. -- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "David" wrote in message ... Hello I have created a Button on a worksheet called Button1 To test it before going any further, since I am so new, I have entered this code in the worksheet Private Sub Button1_Click() MsgBox "you clicked here" End Sub An error message keeps coming up saying: "The macro 'Project.xls!Button1_Click' cannot be found. What am I missing? David |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Because the button that you are using is not a sheet object, so it doesn't
belong in the sheet's code module. If you had used a button from the control toolbox, it would have been a sheet event procedure. -- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "David" wrote in message ... Thanks Bob Why is it that I need to do that? I am used to working with Access where I put all the code into the form. "Bob Phillips" wrote: Put it in a standard code module, not in the worksheet code module. -- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "David" wrote in message ... Hello I have created a Button on a worksheet called Button1 To test it before going any further, since I am so new, I have entered this code in the worksheet Private Sub Button1_Click() MsgBox "you clicked here" End Sub An error message keeps coming up saying: "The macro 'Project.xls!Button1_Click' cannot be found. What am I missing? David |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks Bob
"Bob Phillips" wrote: Because the button that you are using is not a sheet object, so it doesn't belong in the sheet's code module. If you had used a button from the control toolbox, it would have been a sheet event procedure. -- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "David" wrote in message ... Thanks Bob Why is it that I need to do that? I am used to working with Access where I put all the code into the form. "Bob Phillips" wrote: Put it in a standard code module, not in the worksheet code module. -- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "David" wrote in message ... Hello I have created a Button on a worksheet called Button1 To test it before going any further, since I am so new, I have entered this code in the worksheet Private Sub Button1_Click() MsgBox "you clicked here" End Sub An error message keeps coming up saying: "The macro 'Project.xls!Button1_Click' cannot be found. What am I missing? David |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Newbie Run Time Error | Excel Programming | |||
Compile error: Ambigious name detected: Worksheet_Change **NEWBIE** | Excel Programming | |||
Newbie Q: Error handling procedures in a loop | Excel Programming | |||
Newbie: Error 1004 | Excel Programming | |||
error in my VBA (newbie) | Excel Programming |