Select range for function in a cell

F

Fherrera

Hi, is it possible to select create a formula in a cell. such as =SUM(
and have the cursor be between the () so the user can select th
appopriate range to enter? Or would this just be done separately.
(Since one would need to know the range and WHERE to put the formul
in..ie. what cell) similar to if you hit the autosum button but ther
are no numbers above or the left, it simply waits for the user t
select a range and then hits enter.

THanks!
 
R

RagDyer

If I understand what you're asking for, this could be accomplished by having
the user enter the range references into two separate cells.

For example, if you wanted the results of this formula;
=SUM(B10:C20)
to be returned in cell C21,
Enter this formula in C21:

=SUM(INDIRECT(A1&":"&A2))

Then, have the user enter
"B10" (no quotes)
in cell A1, and enter
"C20" (no quotes)
in cell A2.
--

HTH,

RD
==============================================
Please keep all correspondence within the Group, so all may benefit!
==============================================


Hi, is it possible to select create a formula in a cell. such as =SUM()
and have the cursor be between the () so the user can select the
appopriate range to enter? Or would this just be done separately.
(Since one would need to know the range and WHERE to put the formula
in..ie. what cell) similar to if you hit the autosum button but there
are no numbers above or the left, it simply waits for the user to
select a range and then hits enter.

THanks!!
 
F

Fherrera

Frank, you do our name an injustice... Just kidding :D

But it is possible through the help of the horrible horrible SENDKEYS(
function.

The procedure puts in the formula with some dummy range such as A1 an
then it uses keystrokes to get rid of A1 and then wait inside the (
brackets for the user to select a range...

I've heard many bad things about sendkeys() and as such was wonderin
what I should watch out for and if there is anyway to ensure it work
properly...

For example if I ran the macro in the VBE window it does the strokes i
the window so it obviously has to be run from the appropriat
spreadsheet window....

Thanks

Frank Herrer
 
F

Frank Kabel

Hi :)
o.k. anything is possible but I won't use this in my spreadsheets :)
I try to avoid Sendkeys i possible!
 
Top