Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
mmc mmc is offline
external usenet poster
 
Posts: 5
Default invoke a function

I need to invoke a function(fx) once a user clicks on button1
ex. Application.Worksheetfinction.CountA -- Is this correct?
Thanks...

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default invoke a function

assume button1 is a commandbutton named CommandButton1. Then double click
on it in design mode to be taken to the click event

Private Sub Commandbutton1_click()

End Sub

Put in your function there

Private Sub Commandbutton1_click()
msgbox "Count is " & _
application.WorksheetFunction.CountA(Selection)
End Sub

--
Regards,
Tom Ogilvy

"mmc" wrote in message
...
I need to invoke a function(fx) once a user clicks on button1
ex. Application.Worksheetfinction.CountA -- Is this correct?
Thanks...



  #3   Report Post  
Posted to microsoft.public.excel.programming
mmc mmc is offline
external usenet poster
 
Posts: 5
Default invoke a function

Tom, what if i just want the function to pop up without a selection range.
Ex. I just want the "Solver" to come up on the screen?

"Tom Ogilvy" wrote:

assume button1 is a commandbutton named CommandButton1. Then double click
on it in design mode to be taken to the click event

Private Sub Commandbutton1_click()

End Sub

Put in your function there

Private Sub Commandbutton1_click()
msgbox "Count is " & _
application.WorksheetFunction.CountA(Selection)
End Sub

--
Regards,
Tom Ogilvy

"mmc" wrote in message
...
I need to invoke a function(fx) once a user clicks on button1
ex. Application.Worksheetfinction.CountA -- Is this correct?
Thanks...




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default invoke a function

If solver is loaded

Private Sub commandButton1_Click()
CommandBars("Tools").Controls("Sol&ver...").Execut e
End Sub

Note that Solver is an addin - not a worksheet function. If you create a
reference to it in the VBE, you can look at it properties and methods in the
Object browser.


http://support.microsoft.com/support...ver/solver.asp
Creating Visual Basic Macros that Use Microsoft Excel Solver


http://www.solver.com/

--
Regards,
Tom Ogilvy


"mmc" wrote in message
...
Tom, what if i just want the function to pop up without a selection range.
Ex. I just want the "Solver" to come up on the screen?

"Tom Ogilvy" wrote:

assume button1 is a commandbutton named CommandButton1. Then double

click
on it in design mode to be taken to the click event

Private Sub Commandbutton1_click()

End Sub

Put in your function there

Private Sub Commandbutton1_click()
msgbox "Count is " & _
application.WorksheetFunction.CountA(Selection)
End Sub

--
Regards,
Tom Ogilvy

"mmc" wrote in message
...
I need to invoke a function(fx) once a user clicks on button1
ex. Application.Worksheetfinction.CountA -- Is this correct?
Thanks...






Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel invoke REST service function with Xpath fn parse result! Rand0m1y Excel Worksheet Functions 0 June 4th 09 03:43 PM
How do I invoke a call in Excel DeviceConnect Excel Discussion (Misc queries) 5 February 24th 09 09:34 PM
How can I invoke running a macro from within an "IF" function. ron Excel Worksheet Functions 11 February 8th 06 03:35 PM
How do I invoke a VB subroutine that exists in an Add-In? Tom Doster Excel Programming 11 February 1st 05 02:09 PM
Auto invoke of a VBA Sub function Jag Man Excel Programming 3 December 11th 03 09:26 AM


All times are GMT +1. The time now is 02:53 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"