View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_4_] Bob Phillips[_4_] is offline
external usenet poster
 
Posts: 834
Default Insert a function through a command button

I did something similar to this. The problem is that you can't have your
code inserting and the user interacting as Excel does natively, so what I
did was to throw up a dialog asking the user to select the cell to be
included, using Application.Inputbox(...Type:=8) and then get that cell
address and inject it into my string, and return the string from the
function.

--

HTH

Bob

"Subodh" wrote in message
...
I have custom function created in VBA.
I want to use the button to insert the function.
I tried to accomplish is something like inserting the Sum function by
clicking the button so that =sum() appears in the cell and i can type
the number/parameters required.
But, when i tried to do that using a macro recorder then it cannot be
done
Any help would be appreciated.
Thanks in advance.