Results 1 to 4 of 4

Macro for hyperlinks

Threaded View

  1. #1
    Registered User
    Join Date
    07-01-2012
    Location
    Amsterdam
    MS-Off Ver
    Excel 2007
    Posts
    2

    Macro for hyperlinks

    Hello,

    I'm trying to create a macro that creates a number of hyperlinks in an excel document. I need cell A1 in worksheet 1 to link to A1 in worksheet 2. Then B1 to B1 in worksheet 2 and so on. However, i can't get the macro to assign the next row to the hyperlink in the next cell. What I have now is this:

    Dim i As Integer
     
        For i = 1 To Selection.CurrentRegion.Rows.Count
        ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:="", SubAddress:= _
            "Blad2!A1"
        ActiveCell.Offset(1, 0).Select
        Next i
    
    End Sub
    But as you can see all the hyperlinks link to the same cell (A1), where I want them to link to A1, B1, C1 etc. Can someone help me on this? Thanks!

    Joep
    Last edited by Leith Ross; 07-01-2012 at 01:44 PM. Reason: Replaced Italic Tags with Code Tags

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