Quantcast
Channel: Active questions tagged excel - Stack Overflow
Viewing all articles
Browse latest Browse all 88054

Hyperlink loop in VBA

$
0
0

I have a problem, because I want to make program with make hyperlink for folders, I already have this part:

Dim a As String
Dim i As Long
Dim ark1 As Worksheet
Set ark1 = Arkusz1

For i = 1 To 3
    ark1.Cells(i, "A").Select
    a = "TR_"& i
    ActiveCell.Hyperlinks.Add Anchor:=Selection, Address:="C:/"& a, _
    SubAddress:="", ScreenTip:="a", TextToDisplay:=a
Next i

End Sub

But I have folders: TR_1_Jon TR_2_Allex etc. And it is possible to make this loop that excel will be recognize only first part: "TR_1_******"?


Viewing all articles
Browse latest Browse all 88054

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>