+ Reply to Thread
Results 1 to 7 of 7

Userform used to input arguement parameters

  1. #1
    Registered User
    Join Date
    10-20-2017
    Location
    Charlotte
    MS-Off Ver
    2016
    Posts
    20

    Userform used to input arguement parameters

    I haven't written VBA in a long time so I am more than rusty. I just started a job and want to speed up a process of linking a cell to another application we use. Currently, we have to type the function "=cw_act("py","account")"

    The ideal end result would be to hotkey to userform in. Once the userform appears I would like to enter the account # in the input, hit enter and have the active cell complete the function. Essentially, I want the input text box on the userform to complete the "account" parameter for this function.
    Please Login or Register  to view this content.
    I know my code so far is weak, but like I said....its been a while
    Last edited by Leith Ross; 10-20-2017 at 07:21 PM. Reason: Added Code Tags

  2. #2
    Forum Expert Kenneth Hobson's Avatar
    Join Date
    02-05-2007
    Location
    Tecumseh, OK
    MS-Off Ver
    Office 365, Win10Home
    Posts
    2,573

    Re: Userform used to input arguement parameters

    Welcome to the forum!

    InputBox() or even better Application.InputBox() should suffice. The choice depends on if your account number is numeric or a string. For the 1st:
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    10-20-2017
    Location
    Charlotte
    MS-Off Ver
    2016
    Posts
    20

    Re: Userform used to input arguement parameters

    So here is what I have so far:

    Please Login or Register  to view this content.
    The user form doesn't show when I hot key the macro in. Not sure whats going on here...
    Last edited by rbngrt582; 10-21-2017 at 08:25 AM.

  4. #4
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,907

    Re: Userform used to input arguement parameters

    Welcome to the forum.

    Deleted because OP complied to Forum Rules and added Code Tags
    Last edited by bakerman2; 10-21-2017 at 10:43 AM.
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

  5. #5
    Registered User
    Join Date
    10-20-2017
    Location
    Charlotte
    MS-Off Ver
    2016
    Posts
    20

    Re: Userform used to input arguement parameters

    Sorry about that...should be good to go!

  6. #6
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Userform used to input arguement parameters

    When exactly do you want the userform/inputbox to show?

    Would double clicking the cell you want the formula to go into work for you?
    If posting code please use code tags, see here.

  7. #7
    Forum Expert Kenneth Hobson's Avatar
    Join Date
    02-05-2007
    Location
    Tecumseh, OK
    MS-Off Ver
    Office 365, Win10Home
    Posts
    2,573

    Re: Userform used to input arguement parameters

    I don't know why you want to use a userform for a single input. I showed you how to skip using a userform and use an InputBox() instead. If you really want a userform, that can be done.

    The userform shows for me when I add Userform1.Show. If it did not exist in the file with that macro, it would have erred had you pressed Compile. Of course it would have erred in a Run for the same reason. If you close the file with the hotkey, obviously, the hotkey could not play it.

    If you want to assign a hotkey that will work for all files, assign a macro from the Personal workbook.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Display records based on the input parameters
    By Kamalakar M in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 12-30-2015, 09:34 AM
  2. Input Date Parameters
    By murtaza.khan in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-16-2014, 03:21 AM
  3. Automation of Macro input parameters
    By cda123 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-26-2011, 01:50 PM
  4. Dynamic Web Query with multiple input parameters
    By Lukasz in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-01-2010, 12:12 AM
  5. Replies: 2
    Last Post: 03-08-2010, 11:25 AM
  6. Input parameters to an excel Application
    By eitancoh in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-22-2007, 06:35 PM
  7. XIRR function input parameters
    By kieran sweeney in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 04-29-2005, 07:06 AM

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