+ Reply to Thread
Results 1 to 5 of 5

Need help with VB to link button to HYPERLINK formula

  1. #1
    Registered User
    Join Date
    08-25-2017
    Location
    Phoenix, AZ
    MS-Off Ver
    2013
    Posts
    74

    Need help with VB to link button to HYPERLINK formula

    Hello all and thank you in advance,

    I am using Office 2013.

    Please see the attachment. I got a simple piece of VBA code from someone who was nice enough to give it to me. When it works it is supposed to allow the user to click on a button and then, using a macro, it clicks on a cell contents in column "H".

    Explanation: I have eight HYPERLINK formulas in column "H" that populate an email based on contents in column "E". I have buttons in column "F" and I've right clicked on the tab name, and clicked "View Code" and then right clicked on "Sheet 1" named CVG. This links the VBA code I pasted into that module to the button. Next, I've right clicked on each button and selected "Assign macro".

    The VBA code should work but I'm getting an error '9' - subscript out of range. How do I fix it? And please help me to understand the fix as I need to apply it to the actual sheet I am attempting to roll out

    Thank you again
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Need help with VB to link button to HYPERLINK formula

    Apparently the Hyperlinks formula can't be followed with VBA code.

    Here is a solution where you define within each Hyperlinker macro the Recipient address, CC address (optional), Subject text (optional), and Body text (optional). The code makes a hyperlink in cell H1 and then follows it. You can use cell values for any of the four arguments

    Please Login or Register  to view this content.
    Make eight Hyperlinker macros for each button. Each will call the same MakeHyperlink function with their arguments.
    Last edited by AlphaFrog; 11-28-2020 at 12:39 AM.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,155

    Re: Need help with VB to link button to HYPERLINK formula

    Or just code the buttons accordingly...No formula cells
    Please Login or Register  to view this content.
    Last edited by sintek; 11-28-2020 at 06:09 AM.
    Good Luck
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the star to left of post [Add Reputation]
    Also....add a comment if you like!!!!
    And remember...Mark Thread as Solved.
    Excel Forum Rocks!!!

  4. #4
    Registered User
    Join Date
    08-25-2017
    Location
    Phoenix, AZ
    MS-Off Ver
    2013
    Posts
    74

    Re: Need help with VB to link button to HYPERLINK formula

    Thank you! That works!

  5. #5
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,155

    Re: Need help with VB to link button to HYPERLINK formula

    ..........................
    Thanks.gif

+ 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. [SOLVED] Need to link HYPERLINK function to a button to auto generate emails
    By worthmw in forum Excel General
    Replies: 3
    Last Post: 11-25-2020, 01:05 AM
  2. how to use Hyperlink function to convert a link into e-mail link?
    By Eric Tsang in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-05-2020, 12:09 PM
  3. [SOLVED] HYPERLINK Formula - Link to Workbook via Cell Contents
    By acmichae in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-30-2017, 12:54 PM
  4. Replies: 1
    Last Post: 08-19-2016, 08:41 AM
  5. Formula Link between 2 workbooks doesn't work with hyperlink
    By wdowns in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-11-2016, 07:17 AM
  6. Using Hyperlink formula to link to worksheets that will have name changes
    By lhsouza in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 06-14-2014, 08:43 AM
  7. [SOLVED] User Form - Hyperlink Button within a Form, to create a Link on a Designated Cell
    By Sinalk in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-27-2013, 07:29 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