Results 1 to 5 of 5

Hyperlinking cells

Threaded View

  1. #1
    Valued Forum Contributor
    Join Date
    02-21-2010
    Location
    Tokyo, Japan
    MS-Off Ver
    Excel 2007
    Posts
    502

    Hyperlinking cells

    Please have a look at the below sub. I have created 2 such subs for different sheets. One of the 2 is working fine. But for the other I get the error message in Excel that the "Reference is not valid".

    I douple checked the code and looked at the actual hyperlinks that are created (by moving the cursor over the author with the hyperlink). Everything looks OK.

    Does anybody know why I get this error message in Excel?

    Sub Macro1()
    
    Dim LastRow As Long
    Dim i As Long
    
    'Make hyperlink from Authors on sheet J-Journals to sheet J-Affiliation
            
        Sheets("J-Journals").Select
        LastRow = Sheets("J-Journals").Range("A" & Rows.Count).End(xlUp).Row
        
        For i = 2 To LastRow
            With Worksheets("J-Journals")
                .Hyperlinks.Add Anchor:=.Range("A" & i), Address:="", SubAddress:="J-Affiliation!A" & i
            End With
        Next i
        
    End Sub
    Last edited by dschmitt; 04-13-2010 at 01:20 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