Hi all,
Have a wonderful code working as intended from you helpful folk.
I am wondering if it is possible to have a clickable URL appear in the MsgBox? The results in the MsgBox are searched for in a table with the relevant data formatted as hyperlinks, but when I have tried it just comes up as plain text.
Any ideas? Below is the code.
Thanks heaps for any help you may have.
Hayden
Have a wonderful code working as intended from you helpful folk.
I am wondering if it is possible to have a clickable URL appear in the MsgBox? The results in the MsgBox are searched for in a table with the relevant data formatted as hyperlinks, but when I have tried it just comes up as plain text.
Any ideas? Below is the code.
Thanks heaps for any help you may have.
Hayden
VBA Code:
Sub Worksheet_Change(ByVal Target As Range)
Dim lookupval As String
Dim result As Range
Application.EnableEvents = False
On Error GoTo ExitNow
If Not Intersect(Target, Range("B14")) Is Nothing Then
If Len(Target) = 3 Then
lookupval = Target
Set result = Range("M2:M233").Find(lookupval)
If Not result Is Nothing Then
MsgBox " " & vbCrLf & _
"Location Name: " & Range("N" & result.Row) & vbCrLf & _
"3 Letter Code: " & Range("M" & result.Row) & vbCrLf & _
"Lines: " & Range("O" & result.Row) & vbCrLf & _
"Terminating Location: " & Range("P" & result.Row) & vbCrLf & _
"Stabling Location: " & Range("Q" & result.Row) & vbCrLf & _
"Number of Stabling Roads: " & Range("T" & result.Row) & vbCrLf & _
"Meal Break Location: " & Range("R" & result.Row) & vbCrLf & _
"Drivers Depot: " & Range("S" & result.Row) & vbCrLf & _
"Google Map Taxi Pickup: " & Range("U" & result.Row), Title:="Location Info"
Else
MsgBox "Location not found. Please check your spelling and try again.", vbCritical, Title:="Location Not Found"
End If
Else
lookupval = Target
Set result = Range("N2:N233").Find(lookupval)
If Not result Is Nothing Then
MsgBox " " & vbCrLf & _
"Location Name: " & Range("N" & result.Row) & vbCrLf & _
"3 Letter Code: " & Range("M" & result.Row) & vbCrLf & _
"Lines: " & Range("O" & result.Row) & vbCrLf & _
"Terminating Location: " & Range("P" & result.Row) & vbCrLf & _
"Stabling Location: " & Range("Q" & result.Row) & vbCrLf & _
"Number of Stabling Roads: " & Range("T" & result.Row) & vbCrLf & _
"Meal Break Location: " & Range("R" & result.Row) & vbCrLf & _
"Drivers Depot: " & Range("S" & result.Row) & vbCrLf & _
"Google Map Taxi Pickup: " & Range("U" & result.Row), Title:="Location Info"
Else
MsgBox "Location not found. Please check your spelling and try again.", vbCritical, Title:="Location Not Found"
End If
End If
End If
ExitNow:
Application.EnableEvents = True
End Sub