chickenchester
New Member
- Joined
- Jun 30, 2017
- Messages
- 16
Hello,
I created the top half of the coding below to trigger an input box. What I'm trying to do is to use that result in the second half of the coding in the red text below. The box successfully appears and let's me enter the data then disappears. Nothing else happens. I have tried quotations around it and still nothing. Any help is appreciated. Thank you.
Sub example()
Dim result As String
InputData = Application.InputBox("Enter the tab name to add the hyperlink to.", "Enter Tab Name", "Enter Tab Name") 'The variable is assigned the value entered in the InputBox
If result <> "" Then 'If the value anything but "" the result is displayed
MsgBox result
Range("B" & indexRow).Select
ActiveSheet.hyperlinks.Add Anchor:=Selection, Address:="", SubAddress:= _
"InputData!A1", ScreenTip:="Select this link to access the tab.", TextToDisplay:="QTS"
Range("C" & indexRow).Select
ActiveSheet.hyperlinks.Add Anchor:=Selection, Address:="", SubAddress:= _
"'UAT Test Cases Sample (2)'!A1", ScreenTip:="Select this link to access the tab.", TextToDisplay:="UAT"
End If
End Sub
I created the top half of the coding below to trigger an input box. What I'm trying to do is to use that result in the second half of the coding in the red text below. The box successfully appears and let's me enter the data then disappears. Nothing else happens. I have tried quotations around it and still nothing. Any help is appreciated. Thank you.
Sub example()
Dim result As String
InputData = Application.InputBox("Enter the tab name to add the hyperlink to.", "Enter Tab Name", "Enter Tab Name") 'The variable is assigned the value entered in the InputBox
If result <> "" Then 'If the value anything but "" the result is displayed
MsgBox result
Range("B" & indexRow).Select
ActiveSheet.hyperlinks.Add Anchor:=Selection, Address:="", SubAddress:= _
"InputData!A1", ScreenTip:="Select this link to access the tab.", TextToDisplay:="QTS"
Range("C" & indexRow).Select
ActiveSheet.hyperlinks.Add Anchor:=Selection, Address:="", SubAddress:= _
"'UAT Test Cases Sample (2)'!A1", ScreenTip:="Select this link to access the tab.", TextToDisplay:="UAT"
End If
End Sub