Create a hyperlink within an Excel cell?

前端 未结 5 1062
余生分开走
余生分开走 2021-01-18 06:48

Is it possible to create a hyperlink within an Excel cell which only uses a section of the cell text for the clickable link? I.E. would the below table mockup represent som

5条回答
  •  时光说笑
    2021-01-18 07:16

    The above one liner was very helpful... since I'm new, I couldn't comment. So here is my variation of the above that takes each row on a worksheet and builds a URL from a value on the row.

    CHGRow = 3
    Worksheets("Page 1").Select
    Cells(CHGRow, 1).Select
    
    Do Until Application.CountA(ActiveCell.EntireRow) = 0
    
        URLVal = "https://our_url_here?some_parameter=" & Cells(CHGRow, cNumber)
        URLText = Cells(CHGRow, cNumber)
        ActiveSheet.Hyperlinks.Add Anchor:=Cells(CHGRow, cURL), Address:=URLVal, TextToDisplay:=URLText
    
        CHGRow = CHGRow + 1
        Cells(CHGRow, 1).Select
    
    Loop
    

提交回复
热议问题