Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 99
Default Insert a function through a command button

On May 12, 7:25*pm, Subodh wrote:
On May 12, 6:21*pm, "Bob Phillips" wrote:





If the parameter cell is selected, what is the target cell (for the
formula)?


And can you be sure some other cell won't get selected?


--


HTH


Bob


"Subodh" wrote in message


...
On May 12, 1:57 pm, "Bob Phillips" wrote:


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.- Hide quoted text -


- Show quoted text -


I think in my case, application.inputbox is not needed.
Coz, the desired cell is already selected So, its very easy to get
that cell address.
So, I only need to get a way to inject the cell address to the string
to use the function, i hope
that it would be possible.
Thanks for your prompt response.- Hide quoted text -


- Show quoted text -


I want to insert the function in the cell that is selected.
So, in my opinion the selected cell itself is the target cell
Or, let me explain again what i need to do.
I have to insert my custom function lets say mysub() in the selected
cell A1
Now, I have selected the cell A1
My funciton has one argument (and the agrument is not optional)
So, when i click on the button, and then run the macro,
I should be able to get in the selected cell something like
="=mysub(..)"
with the cursor in between the parenthesis. Like the one we get when
we click the appropriate buttom for the sum function as an example.
Thanks for your concern.- Hide quoted text -

- Show quoted text -


I didn't thought it was a difficult problem,
but i don't know if it was because i couldn't explain the case or my
question properly or
that it was really a difficult problem??
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
Code for my Command Button to automatically copy and insert a new tommy Excel Discussion (Misc queries) 0 January 28th 09 12:22 AM
Command Button Function bob Excel Programming 1 February 6th 07 06:12 PM
I can't insert a Command Button into my spreadsheet Stephen238 Excel Programming 3 June 30th 05 08:43 PM
Insert a command Button Dustin Excel Programming 2 June 16th 04 01:08 AM
Using a command button to insert a new row. Jared[_2_] Excel Programming 1 December 29th 03 08:43 PM


All times are GMT +1. The time now is 08:32 AM.

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

About Us

"It's about Microsoft Excel"