View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Gary''s Student Gary''s Student is offline
external usenet poster
 
Posts: 11,058
Default Can I request user in input variable value within formula?

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.