Results 1 to 2 of 2

Hyperlink creations

Threaded View

  1. #1
    Registered User
    Join Date
    06-14-2018
    Location
    texas
    MS-Off Ver
    2010
    Posts
    2

    Post Hyperlink creations

    Hi, I'm fighting with a macro to create hyperlinks.

    The hyperlink point into another sheet of the same workbook.

    Here the code:

    'capannone interno
    Dim sFila(1 To 5) As String
    sFila(1) = "A"
    sFila(2) = "H"
    sFila(3) = "O"
    sFila(4) = "V"
    sFila(5) = "AC"
    
    Worksheets("Nomi").Activate
    test = 6
    n = 201
    
    For rig = 562 To 1354 Step 40
        For i = 1 To 5
            Set cella = range(Cells(rig, 1), Cells(rig + 7, 1))
            cella.Select
            
            MsgBox cella.Address ' this messagebox give me the exact information!
            MsgBox n                                               
            MsgBox ("Esterno!" & sFila(i) & test)
            
            ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:="", _
                SubAddress:="Esterno!" & sFila(i) & test, _
                TextToDisplay:=CStr(n)
            With ActiveCell
                    .Value = n
                    .Font.Color = vbRed
                    .Font.Size = 20
                    .Font.Bold = True
            End With
            rig = rig + 8
            n = n + 1
        Next i
        test = test + 3
    Next rig
    
    MsgBox ("OK!")
    End Sub
    The 3 messagebox in the code give me the correct information but I don't understand why the code don't work.
    first message box: $A$562:$A$569 (that is the first merged cell I want to made hyperlink, the 201 sheet Nomi)
    second message box: 201 (that is the cell value)
    third message box: Esterno!A6 (the cell where the hyperlink point to)

    for some reason the code skip this information and in the range $A$562:$A$569 even if the message box tell me that is working in the next range (from message box, $A570:$A$577, the merged cell 202) he write the new information so the cell 202 and the hyperlink is Esterno!H6. In the previus range (the A562:A569) I don't find something strange.

    Anyway, the merged cell 201 in Nomi point to cell 202 in Esterno, and 202 in Nomi point to 202 in Esterno and so on. The problem is only in the first merged cell.

    Thanks to anyone for the help!

    This is the worksheet Nomi
    2.png

    and this is the worksheet Esterno
    1.png
    Last edited by joker888; 06-14-2018 at 05:33 AM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] With Hyperlink formula & vba, I want to copy text of hyperlink to the cell it's linked to
    By Freakytone in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-13-2017, 05:46 PM
  2. [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
  3. Using Vlookup to pull hyperlink from Master Hyperlink file list.
    By theflyingnimbus in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 04-02-2013, 01:42 PM
  4. Replies: 1
    Last Post: 02-23-2013, 05:18 AM
  5. Permutation creations on excel
    By jaheimando in forum Excel - New Users/Basics
    Replies: 6
    Last Post: 02-18-2010, 08:54 AM
  6. Replies: 2
    Last Post: 12-08-2008, 10:01 AM
  7. Replies: 5
    Last Post: 06-22-2006, 07:10 AM

Tags for this Thread

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