+ Reply to Thread
Results 1 to 5 of 5

Hyperlink variable in formula syntax

  1. #1
    Registered User
    Join Date
    07-31-2008
    Location
    ca
    Posts
    10

    Hyperlink variable in formula syntax

    I'm trying to pass a cell reference in a hyperlink as a formula like this:

    'ActiveCell.FormulaR1C1 = "=HYPERLINK(""http://www.mysitr.com/search/searchresults.aspx?zp=""&A2&""&typ=7"",""zip search"")"

    but get an error. How do I handle the quotes around the cell?

    Outside of a formula, this works:
    =HYPERLINK("http://www.mysite.com/search/searchresults.aspx?zp="&A2&"&typ=7","zip search")

    Thanks in advance!

  2. #2
    Valued Forum Contributor Richard Schollar's Avatar
    Join Date
    05-23-2006
    Location
    Hampshire UK
    MS-Off Ver
    Excel 2002
    Posts
    1,264
    Hi

    Your error is being caused by you mixing A1-style references in your formula string with the FormulaR1C1 property of the cell. Change to:

    Please Login or Register  to view this content.
    Richard

  3. #3
    Registered User
    Join Date
    07-31-2008
    Location
    ca
    Posts
    10
    Thank you! One more question, what's the syntax for the 2nd part (link name)? I want to use the value of A2 as the name.

    Please Login or Register  to view this content.

  4. #4
    Valued Forum Contributor Richard Schollar's Avatar
    Join Date
    05-23-2006
    Location
    Hampshire UK
    MS-Off Ver
    Excel 2002
    Posts
    1,264
    That doesn't need to be in quotes so:

    Please Login or Register  to view this content.
    Richard

  5. #5
    Registered User
    Join Date
    07-31-2008
    Location
    ca
    Posts
    10
    Thank you!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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