08.07.2020, 18:35
hallo
ich habe diesen vba-Code aus Internet und versuche nach meiner Vorstellung anzupassen, bekomme einen Fehler: object erforderlich
kann jemand helfen?
Danke Euch
Sub WordLink()
Dim rng As Range
Dim rng2 As Range
Dim rng3 As Range
Set rng2 = Application.InputBox(Prompt:="Enter Cell Number or SheetName!Cell Number, e.g. Color!D16", Type:=8)
Set rng3 = Application.InputBox(Prompt:="Enter Text to Disply with Hyperlink", Type:=8)
rng.Parent.Hyperlinks.Add anchor:=ActiveCell, Address:="", SubAddress:=rng2, TextToDisplay:=rng3
With rng.Font
.ColorIndex = xlAutomatic
.Underline = xlUnderlineStyleNone
End With
With rng.Characters(Start:=9, Length:=4).Font
.Underline = xlUnderlineStyleSingle
.Color = -4165632
End With
End Sub
ich habe diesen vba-Code aus Internet und versuche nach meiner Vorstellung anzupassen, bekomme einen Fehler: object erforderlich
kann jemand helfen?
Danke Euch
Sub WordLink()
Dim rng As Range
Dim rng2 As Range
Dim rng3 As Range
Set rng2 = Application.InputBox(Prompt:="Enter Cell Number or SheetName!Cell Number, e.g. Color!D16", Type:=8)
Set rng3 = Application.InputBox(Prompt:="Enter Text to Disply with Hyperlink", Type:=8)
rng.Parent.Hyperlinks.Add anchor:=ActiveCell, Address:="", SubAddress:=rng2, TextToDisplay:=rng3
With rng.Font
.ColorIndex = xlAutomatic
.Underline = xlUnderlineStyleNone
End With
With rng.Characters(Start:=9, Length:=4).Font
.Underline = xlUnderlineStyleSingle
.Color = -4165632
End With
End Sub