+ Reply to Thread
Results 1 to 3 of 3

User Form - Hyperlink Button within a Form, to create a Link on a Designated Cell

  1. #1
    Registered User
    Join Date
    07-30-2013
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    11

    User Form - Hyperlink Button within a Form, to create a Link on a Designated Cell

    Hi,

    Introduction:
    I have just started using Excel VBA and am slowly learning the program for a project at work, using online tutorials, watching Macros being recorded and this really helpful forum.

    However I need help, as I can not get my head around how I should do the following:

    Issue:
    I am currently creating a user form in which an individual can type in several variables and at the click of a button, the software, will paste the information on to the spreadsheet.
    However I want to be able to create a command button within the user form that when clicked will:
    1. Input a text, e.g. "Resume".
    2. Prompt the Hyperlink Dialogue Window to Appear.
    3. Individual selects appropriate document and clicks 'OK'.
    4. When Individual closes the user form, the next available empty row and cell is populated with the text "Resume" and the corresponding Hyperlink.

    Current Solution:
    Currently for the 'Hyperlink Command Button' within the user form, I have utilised the following Excel VBA code:

    Please Login or Register  to view this content.
    & The following happens:
    1. User clicks the command button - 'InsertHyperlinkCommandButton'
    2. Text value of "Resume" inputs itself on the next available empty row, on column 5.
    3. The Hyperlink Dialogue Window Appears
    4. User selects their required document and clicks 'OK'
    5. Hyperlink is created but on the last highlighted cell, not on the next available empty row, on column 5.

    I think that the reason why the hyperlink is not being pasted on to the required cell is down to the 'Export Data to worksheet' part of the VBA code. However I can not figure out what I should be typing instead.

    Other:
    I have attached an example worksheet of the VBA Code that I have shown above in working practice, below, as I am restricted on not being allowed to upload anything to do with work.
    Example - Userform.xlsm

    Thank you in advance.
    Sinalk
    Last edited by Sinalk; 08-27-2013 at 06:24 AM.

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,436

    Re: User Form - Hyperlink Button within a Form, to create a Link on a Designated Cell

    as the dialog applys the hyperlink to the active cell try making the relevant cell active first

    Please Login or Register  to view this content.
    You example shows mailto hyperlinks for each email address. If that is the case you can probably do away with the dialog.
    Cheers
    Andy
    www.andypope.info

  3. #3
    Registered User
    Join Date
    07-30-2013
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    11

    Re: User Form - Hyperlink Button within a Form, to create a Link on a Designated Cell

    Hi Andy!
    1. Firstly just want to say thank you for your quick response, your solution worked perfectly.
    2. The 'Mailto Hyperlink' for each e-mail address was just part of the excel worksheet as an example and not my main hyperlinking issue, apologies if I confused you there.

    I just made a minor tweak to your VBA code, in which I changed the first line of information from a 4 to a 5. As I wanted the hyperlink to be created on the same cell as where the value "Resume" would have been placed.

    Please Login or Register  to view this content.
    Thank you again, it was much appreciated.

    Kind Regards,
    -Sinalk

+ 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. Link Form Control Button to Cell Location?
    By bennetas in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 09-22-2016, 07:48 AM
  2. Link User Form Text Box to worksheet cell
    By jamphan in forum Excel General
    Replies: 11
    Last Post: 07-20-2014, 10:45 AM
  3. vba user form to create message depend on option button/check box
    By young_86 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-03-2013, 06:12 AM
  4. How to link user form to cell with formula
    By earlewallbank in forum Excel Programming / VBA / Macros
    Replies: 18
    Last Post: 04-03-2013, 03:16 PM
  5. Is it possible to read a form button location or cell link?
    By ifwhitfi in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-15-2012, 04:45 PM

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