Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have 3 worksheets, 1 is results, 1 is calculation, and the 3rd is the data
input interface. On the third I have buttons that need to execute and update field command. I can't get the button to work, when I run the program in VBA it can't find the function I am trying to call because it is a different module. I've tried sharing it, and making it public.... any ideas? |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Jenny,
Try posting your button code and, possibly, the function. --- Regards, Norman "Jenny" wrote in message ... I have 3 worksheets, 1 is results, 1 is calculation, and the 3rd is the data input interface. On the third I have buttons that need to execute and update field command. I can't get the button to work, when I run the program in VBA it can't find the function I am trying to call because it is a different module. I've tried sharing it, and making it public.... any ideas? |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
So, this is my button code, I keep getting error 9 on the 4th line: Sub CommandButton1_Click() Dim button1 As Module Set button1 = Modules!["calc"] CommandButton1.Caption = "refresh critical ratio table" button1 End Sub "calc" is the name of the module I need to access, within that module is a sub procedure called "valuesearch" that needs to run on command. Thanks! "Norman Jones" wrote: Hi Jenny, Try posting your button code and, possibly, the function. --- Regards, Norman "Jenny" wrote in message ... I have 3 worksheets, 1 is results, 1 is calculation, and the 3rd is the data input interface. On the third I have buttons that need to execute and update field command. I can't get the button to work, when I run the program in VBA it can't find the function I am trying to call because it is a different module. I've tried sharing it, and making it public.... any ideas? |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Jenny,
Try: '============== Sub CommandButton1_Click() CommandButton1.Caption = "refresh critical ratio table" Call ValueSearch End Sub '<<============== --- Regards, Norman "Jenny" wrote in message ... Hi, So, this is my button code, I keep getting error 9 on the 4th line: Sub CommandButton1_Click() Dim button1 As Module Set button1 = Modules!["calc"] CommandButton1.Caption = "refresh critical ratio table" button1 End Sub "calc" is the name of the module I need to access, within that module is a sub procedure called "valuesearch" that needs to run on command. Thanks! "Norman Jones" wrote: Hi Jenny, Try posting your button code and, possibly, the function. --- Regards, Norman "Jenny" wrote in message ... I have 3 worksheets, 1 is results, 1 is calculation, and the 3rd is the data input interface. On the third I have buttons that need to execute and update field command. I can't get the button to work, when I run the program in VBA it can't find the function I am trying to call because it is a different module. I've tried sharing it, and making it public.... any ideas? |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi again,
So, I am definitely getting closer, but now the sub function is not defined, specifically valuesearch. How can I define it? Jenny "Norman Jones" wrote: Hi Jenny, Try: '============== Sub CommandButton1_Click() CommandButton1.Caption = "refresh critical ratio table" Call ValueSearch End Sub '<<============== --- Regards, Norman "Jenny" wrote in message ... Hi, So, this is my button code, I keep getting error 9 on the 4th line: Sub CommandButton1_Click() Dim button1 As Module Set button1 = Modules!["calc"] CommandButton1.Caption = "refresh critical ratio table" button1 End Sub "calc" is the name of the module I need to access, within that module is a sub procedure called "valuesearch" that needs to run on command. Thanks! "Norman Jones" wrote: Hi Jenny, Try posting your button code and, possibly, the function. --- Regards, Norman "Jenny" wrote in message ... I have 3 worksheets, 1 is results, 1 is calculation, and the 3rd is the data input interface. On the third I have buttons that need to execute and update field command. I can't get the button to work, when I run the program in VBA it can't find the function I am trying to call because it is a different module. I've tried sharing it, and making it public.... any ideas? |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Jenny,
(1) Check that the macro name is spelled correctly. (2) Is the macro in a standard module in the same workbook as the command button? (3) Where is the command button code? --- Regards, Norman "Jenny" wrote in message ... Hi again, So, I am definitely getting closer, but now the sub function is not defined, specifically valuesearch. How can I define it? Jenny "Norman Jones" wrote: Hi Jenny, Try: '============== Sub CommandButton1_Click() CommandButton1.Caption = "refresh critical ratio table" Call ValueSearch End Sub '<<============== --- Regards, Norman "Jenny" wrote in message ... Hi, So, this is my button code, I keep getting error 9 on the 4th line: Sub CommandButton1_Click() Dim button1 As Module Set button1 = Modules!["calc"] CommandButton1.Caption = "refresh critical ratio table" button1 End Sub "calc" is the name of the module I need to access, within that module is a sub procedure called "valuesearch" that needs to run on command. Thanks! "Norman Jones" wrote: Hi Jenny, Try posting your button code and, possibly, the function. --- Regards, Norman "Jenny" wrote in message ... I have 3 worksheets, 1 is results, 1 is calculation, and the 3rd is the data input interface. On the third I have buttons that need to execute and update field command. I can't get the button to work, when I run the program in VBA it can't find the function I am trying to call because it is a different module. I've tried sharing it, and making it public.... any ideas? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Public, Private, Event modules, Forms modules,,, | Excel Programming | |||
Basic question - modules and class modules - what's the difference? | Excel Programming | |||
When to code in sheet or userform modules and when to use modules | Excel Programming | |||
Need Help Connecting To DB | Excel Programming | |||
Class Modules vs Modules | Excel Programming |