View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
R Nelson[_2_] R Nelson[_2_] is offline
external usenet poster
 
Posts: 6
Default Can I request user in input variable value within formula?

Thanks, that is exactly what I was looking for!!!

"Gary''s Student" wrote:

Try this small macro:

Sub uservalue()
x = Application.InputBox(prompt:="enter the value", Type:=1)
Range("A3").Formula = "=" & x & "*A1"
End Sub


--
Gary''s Student - gsnu200789


"R Nelson" wrote:

I don't even know if this can be done, but I would like to request the user
to define the value of a variable within a formula without having to
reference a separate data table or cell

Example imaginary formula:

A3 =(USER DEFINED VALUE) * A1

Such that the user inputs the value direction into the cell but the shown
value is the fuction result.