View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
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...