excel hyperlink to nothing

前端 未结 4 1314
旧巷少年郎
旧巷少年郎 2020-11-27 23:25

I\'ve got a lot of hyperlinks and I want to assign a macros to each of them and Worksheet_FollowHyperlink captures only Inserted Hyperlinks but not the HYPERLINK() function.

4条回答
  •  情书的邮戳
    2020-11-28 00:05

    Good solution Excel Hero but not for everything: I try to make a kind of outline but it's impossible to hide a row in the function: nothing happen! But if a make a direct call to the same code with a button, everything works fine. This is my test:

    Function test()
    
    Set test = Selection
    
     Dim i, j, state As Integer
    state = Selection.Value
    i = Selection.Row + 1
    j = i
    
    If state = "6" Then
    
        Do Until ActiveSheet.Cells(j, 7).Value = 1 Or ActiveSheet.Cells(j, 4).Value = ""
            j = j + 1
        Loop
        ActiveSheet.Rows(i & ":" & j - 1).EntireRow.Hidden = True
        Debug.Print "test group: " & i & ":" & j - 1
    Else
        Do Until ActiveSheet.Cells(j, 7).Value = 1 Or ActiveSheet.Cells(j, 4).Value = ""
            j = j + 1
        Loop
        ActiveSheet.Rows(i & ":" & j - 1).EntireRow.Hidden = False
        Debug.Print "test ungroup: " & i & ":" & j - 1
    End If
    

    End Function

    My debug.print give me this:

    test group: 4:26

提交回复
热议问题