Hi,
I've encountered a strange error.
Last row makes a run-time error '5' if I delete then row marked as solution.
Can anyone explain the reason?
(Office 2019 Home & Business)
Thanks!
Code
Sub Test()
Dim a As String
Dim b As String
Dim c As String
Range("A1").Hyperlinks.Add anchor:=Range("A1"), Address:="any address", TextToDisplay:="Link"
a = Range("A1").Hyperlinks(1).Address
b = Range("A1").Hyperlinks(1).screentip
c = Range("A1").Hyperlinks(1).TextToDisplay
If b = "" Then b = "" 'THIS IS THE SOLUTION. Without it the Hyperlinks.Add makes run-time error '5'
Range("B1").Hyperlinks.Add anchor:=Range("B1"), Address:=a, screentip:=b, TextToDisplay:=c
End Sub
Display More