Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Sub LoopSelection()
- Dim cel As Range
- Dim selectedRange As Range
- Dim aa As String
- Dim counter As Integer
- counter = 2
- Set selectedRange = Application.Selection
- For Each cel In selectedRange.Cells
- Debug.Print cel.Address
- If cel.Hyperlinks.Count > 0 Then
- aa = cel.Hyperlinks.Item(1).SubAddress
- If cel.Hyperlinks.Item(1).SubAddress Like "*!*" Then
- cel.Hyperlinks.Item(1).SubAddress = Trim(Split(aa, "!")(0)) & "!A" & counter
- End If
- counter = counter + 1
- Debug.Print cel.Hyperlinks.Item(1).SubAddress
- End If
- Next cel
- $I$10 1
- CommLinkItem_57!A2
- $I$11 1
- CommLinkItem_57!A3
- $I$12 1
- CommLinkItem_57!A4
- $I$13 1
- CommLinkItem_57!A5
- $I$14 1
- CommLinkItem_57!A6
- $I$15 1
- CommLinkItem_57!A7
- $I$16 1
- CommLinkItem_57!A8
- $I$17 1
- CommLinkItem_57!A9
- $I$18 1
- CommLinkItem_57!A10
- $I$19 1
- CommLinkItem_57!A11
- $I$20 1
- CommLinkItem_57!A12
Add Comment
Please, Sign In to add comment