+ Reply to Thread
Results 1 to 4 of 4

User Form Formula

  1. #1
    sbruner
    Guest

    User Form Formula

    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?

  2. #2
    Jim Thomlinson
    Guest

    RE: 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?


  3. #3
    Bob Phillips
    Guest

    Re: User Form Formula

    ans = Inputbox("Please supply a product code")

    --
    HTH

    Bob Phillips

    "sbruner" <[email protected]> wrote in message
    news:[email protected]...
    > 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?




  4. #4
    jjk
    Guest

    Re: User Form Formula

    You should look up some tutorials.

    Reading the codes from these projects is a good start.
    <single line>
    http://support.microsoft.com/search/...rform+tutorial
    </single line>


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1