Exceeding Max Char Limit in Excel

后端 未结 11 1690
名媛妹妹
名媛妹妹 2020-12-10 06:51

How do I use more than 255 characters in Excel\'s CONCATENATE function? I am actually also using the CONCATENATE function within the HYPERLINK function in EXCEL. An example

11条回答
  •  猫巷女王i
    2020-12-10 07:34

    Dunno if my answer is still useful but I had the same issue couple of days ago, the best way and proved way to do a workable hyperlink that exceeds a 255 char limit is to first split it, with CONCATENATE(), and use the cell with CONCATENATE() function in VBA.

    For me it looks like:

    A1 = LinkPart1
    A2 = LinkPart2
    A3 = LinkPart3
    
    A5 = CONCATENATE( A1; A2; A3 )
    

    VBA Code you need to link with A5:

    Sub insertVeryLongHyperlink()
    
        Dim curCell As Range
        Dim longHyperlink As String
    
        Set curCell = Range("A7")   ' or use any cell-reference
        longHyperlink = [A5]
    
        curCell.Hyperlinks.Add Anchor:=curCell, _
                        Address:=longHyperlink, _
                        SubAddress:="", _
                        ScreenTip:=" - Click here to follow the hyperlink", _
                        TextToDisplay:="Click Here"
    
        End Sub
    

提交回复
热议问题