+ Reply to Thread
Results 1 to 6 of 6

Create a Hyperlink

Hybrid View

  1. #1
    Registered User
    Join Date
    08-16-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    59

    Create a Hyperlink

    Hi All,

    I am trying to create a hyperlink on the first column of a report, after the report is generated.

    for the address, I need to read values from the content of other fields in the report as in


    This is part of the hyperlink code, I am using

    For i to LastRow
    Str = “http://” & range(“URLAddress”).value & “ph=” & cell_that_contains_phoneNo & “st=” & cell_that_contains_starttimevalue & “et=” & cell_that_contains_endtimevalue

    Range("A” & i").Select
    ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address=Str, TextToDisplay:="HLink"
    Next i

    How do I read the ph, st and et values?
    cell_that_contains_phoneNo - 9th field
    cell_that_contains_starttimevalue - 2nd field
    cell_that_contains_endtimevalue - 3rd field.


    Also, I am creating this hyperlink after the report is generated. The above code takes a while to create hyperlink, if the number of rows are large. Is there a better code which creates the links faster?

    Thanks,

    Rollin

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Create a Hyperlink

    Are you fully qualifying the cells with the ph, st, & et values with the sheet name as well?

    Upload the workbook for more definitive advice.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Registered User
    Join Date
    08-16-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    59

    Re: Create a Hyperlink

    Hi Richard,

    Yes, I am fully qualifying the cells with the ph, st, & et values with the sheet name.

    I am not sure of the code to read values off multiple cells.

    Also, this code will be a part of the initial code for the report, which is too large to post and I am not sure of the size.

  4. #4
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Create a Hyperlink

    We don't need an all singing all dancing workbook with zillions of rows, cut it down in size and just send one that has the relevant bits.

  5. #5
    Registered User
    Join Date
    08-16-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    59

    Re: Create a Hyperlink

    Hi Richard,

    I have attached the excel sheet, which I have posted the format sheet. I use this code after my initial report is created.
    Currently, I manually created a hyperlink for testing purposes.

    I need to insert a column in before col B and name it "Hlink". Also, I need to have this column as hyperlinked and the text called "CONNECT"

    for the address, I need to read values from the content of other fields in the report as in


    This is part of the hyperlink code, I am using

    For i to LastRow
    Str = “http://" & range(“URLAddress”).value &"sc=" testing & "ph=" & cell_that_contains_phoneNo & "st=" & cell_that_contains_starttimevalue & "et=" & cell_that_contains_endtimevalue

    Range("A” & i").Select
    ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address=Str, TextToDisplay:="CONNECT"
    Next i

    How do I read the sc, ph, st and et values?
    sc: cell that contains service type (if the value is GUIDE, then sc = testing)
    ph :cell_that_contains_phoneNo - 6th field
    st:cell_that_contains_starttimevalue - 2nd field
    et:cell_that_contains_endtimevalue - 3rd field.

    Also, I am creating this hyperlink after the report is generated.

    Thanks,

    Rollin
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    08-16-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    59

    Re: Create a Hyperlink

    Hi All,

    Any help on this?

+ 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] Macros to Create New Sheet, Rename, and Create HyperLink to New Worksheet
    By jacksum in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-19-2015, 12:44 PM
  2. Macro to find a word in a cell, create a transparent text zone over it, create a hyperlink
    By martin brandl in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-17-2015, 03:24 PM
  3. [SOLVED] Excel 2010 Create a macro to check if cell contains hyperlink then apply hyperlink style
    By chasidar in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-12-2013, 04:48 AM
  4. Replies: 3
    Last Post: 11-12-2012, 10:33 AM
  5. Replies: 0
    Last Post: 10-10-2011, 05:11 PM
  6. create a hyperlink back to a previous hyperlink
    By JT_Krupa in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-21-2011, 11:22 AM
  7. How do I create a hyperlink to a cell with the hyperlink function
    By S. Bevins in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-20-2006, 03:06 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