View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jim Thomlinson[_4_] Jim Thomlinson[_4_] is offline
external usenet poster
 
Posts: 1,119
Default User Form Formula

Your question is kind of vague so here is a very generic bit of code for you
to loo at...

Public Sub GetDataFromUser()
Dim strUserInput As String

strUserInput = InputBox("Please enter your name.", "Name")

MsgBox "Your name is " & strUserInput

Call GetAddress(strUserInput)
End Sub

Private Sub GetAddress(ByVal UserName As String)
Dim strAddress As String

strAddress = InputBox("Hi, " & UserName & ". What is your address",
"Address")

MsgBox UserName & " lives at " & strAddress

End Sub

It gets the user to inut their name. That name is output and then passed to
another procedure to be used some more.
--
HTH...

Jim Thomlinson


"sbruner" wrote:

I have created the template for a user form at the beginning of a macro. It
simply asks the user to enter a product code and click Ok.
I am not a professional programmer and am unsure how to take the information
that the user inputs and store it as a variable to be repeatedly called up in
my macro at various points. Can anyone help?