Results 1 to 2 of 2

Help with Syntax Using R1C1 in VBA

Threaded View

  1. #1
    Registered User
    Join Date
    10-09-2009
    Location
    Cambridge, MA
    MS-Off Ver
    Excel 2003
    Posts
    61

    Help with Syntax Using R1C1 in VBA

    Hello,

    I'm trying to create some code to hyperlink cells, but I can't quite get the coding right to make the cell go where I want. I'm close though....

     Worksheets("TOC").Hyperlinks.Add anchor:=Worksheets("TOC").Cells(j, i), Address:="", SubAddress:="'" & Worksheets("TOC").Cells(i, 2).Value & "!" & Cells(6, Cells(j, i + 1).Value) '"
    I want the end portion to return Worksheet!C6, but it returns Worksheet!3. It's picking up the right column number (3), but I want the R1C1 of (6,3) to turn into a hyperlink of Worksheet!C6.

    I somehow need to rework the end of the line to make the R1C1 reference turn into an actual address. It'll always link to the 6th row, but the column changes and the column number is always going to be in Cells(j, i+1).

    Any help would be much appreciated.

    Thanks!
    Last edited by nofzinger; 12-21-2010 at 11:38 AM.

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