+ Reply to Thread
Results 1 to 8 of 8

vba for step by step input of url

  1. #1
    Registered User
    Join Date
    04-24-2013
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    6

    vba for step by step input of url

    Hi, I know that there are several ways to input url's into excel, but I am creating a sheet for users with little to no excel experience. One of the features I would like to include is a step by step process for them to input urls. I would like them to be able to push a button and have a dialog box open where they can paste a url, then once this is done I would like to have a new dialog box open that asks them for a simple name for their url. I would like this to be saved in what ever active cell they are in when they push the initial button.

    I guess the example would be
    1) They are in cell A4 and push a button that says "Input URL".
    2) The a dialog box opens with instructions to paste a url so they copy and paste "http://www.excelforum.com/forum-rules/642590-forum-rules.html" from their address bar and hit "save"
    3) A dialog box opens and asks them for a friendly name for their url and they type "Excel Form Rules"
    4) A Hyperlink with the description "Excel Forum Rules" appears in cell A4.

    I hope this is a clear explanation of what I want to do and that there is a way to do so.
    Thanks.

  2. #2
    Valued Forum Contributor AlvaroSiza's Avatar
    Join Date
    09-19-2007
    Location
    Staffordshire
    MS-Off Ver
    2007
    Posts
    591

    Re: vba for step by step input of url

    Here you go. It also traps the error when user forgets to add "http://" and instead just enters www.yyyyy.com. Hope this helps,

    Please Login or Register  to view this content.
    Perhaps it was the Noid who should have avoided me...
    If you are satisfied with my solution click the small star icon on the left. Thanks
    1. Make a copy of your workbook and run the following code on your copy (just in case)
    2. With excel open, press ALT+F11 to open the Visual Basic Editor (VBE). From the "Insert" menu, select "Module".
    3. Paste the code from above into the empty white space. Close the VBE.
    4. From the developer tab, choose "Macros", select the Sub Name, and click "Run".

  3. #3
    Registered User
    Join Date
    04-24-2013
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: vba for step by step input of url

    This was exactly what I wanted, thank you so much.

  4. #4
    Registered User
    Join Date
    04-24-2013
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: vba for step by step input of url

    One last question (I think). Would it be possible to modify that code to use for inputting an email address in a similar way?

  5. #5
    Valued Forum Contributor AlvaroSiza's Avatar
    Join Date
    09-19-2007
    Location
    Staffordshire
    MS-Off Ver
    2007
    Posts
    591

    Re: vba for step by step input of url

    Do you want it structured so that prior to the first input box, the user is asked whether they will be entering a URL OR email? To me, this is the most logical route.

  6. #6
    Registered User
    Join Date
    04-24-2013
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: vba for step by step input of url

    Yes that would be a great way to structure it.

  7. #7
    Valued Forum Contributor AlvaroSiza's Avatar
    Join Date
    09-19-2007
    Location
    Staffordshire
    MS-Off Ver
    2007
    Posts
    591

    Re: vba for step by step input of url

    I changed my mind. Asking the user which one is not really suited for VBA's msgbox possibilities and would require the creation of a userform. Instead, I'm allowing user to enter either, and then running the appropriate code based upon:

    a. An e-mail address
    b. A web address with http://
    c. A web address without http:// (user forgets and only enters www.amazon.com, for example).

    Give it a go and see how it works for you.

    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    04-24-2013
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: vba for step by step input of url

    That is perfect! Thank you very much, i really appreciate it. That was exactly what I was looking for.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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