Hello,
I want to change the Hyperlink with VBA.
I need the adress: "Workbookname - Prozessparameter_2K!A1"
But when I start the code the workbookname doesn't take.. the adress that i get when I start the code is: wbNameProzessparameter_2K!A1
In my workbook I have several sheets that are hidden. When I show the sheets with a tick, the link on the text field has to change so that I can get to the newly shown page with the text field.
Sub Texfeld()
If ActiveWorkbook.Sheets("Prozessparameter_2K").Visible = True Then
Dim wbName As String
wbName = Application.ActiveWorkbook.Name
ActiveSheet.Shapes.Range(Array("TextBox 30")).Select
Selection.ShapeRange.Item(1).Hyperlink.Delete
ActiveSheet.Hyperlinks.Add Anchor:=Selection.ShapeRange.Item(1), Address:="" & wbName
Selection.ShapeRange.Item(1).Hyperlink.Address = "wbName" & "Prozessparameter_2K!A1"
End If
End Sub
Thank you.
I want to change the Hyperlink with VBA.
I need the adress: "Workbookname - Prozessparameter_2K!A1"
But when I start the code the workbookname doesn't take.. the adress that i get when I start the code is: wbNameProzessparameter_2K!A1
In my workbook I have several sheets that are hidden. When I show the sheets with a tick, the link on the text field has to change so that I can get to the newly shown page with the text field.
Sub Texfeld()
If ActiveWorkbook.Sheets("Prozessparameter_2K").Visible = True Then
Dim wbName As String
wbName = Application.ActiveWorkbook.Name
ActiveSheet.Shapes.Range(Array("TextBox 30")).Select
Selection.ShapeRange.Item(1).Hyperlink.Delete
ActiveSheet.Hyperlinks.Add Anchor:=Selection.ShapeRange.Item(1), Address:="" & wbName
Selection.ShapeRange.Item(1).Hyperlink.Address = "wbName" & "Prozessparameter_2K!A1"
End If
End Sub
Thank you.