C
csjames
Below is my code. I keep receiving a "Type Mismatch" error '13'. And no
matter what I try I can't get it to work. Please help!
Sub GetAnswer()
' Created by CJ
'Enter an abbreviation and this will tell you which branch it is for.
Dim Num As Variant
Dim Answer As Variant
Dim msg As String
Dim Ans As Variant
Dim Nums As Variant
'Prompt for a value
Do
Num = InputBox("What is the branch number you would like to look up?")
'Exit if cancelled
If Num = "" Then Exit Sub
'Look up the abbreviation and return an answer.
Answer = Application.VLookup(Num, "Branch Numbers", 4, False)
MsgBox Answer
'Show which branch the number goes to
MsgBox Num & " is the PDSN Branch #" & Answer & "."
'Ask if they would like to look up another number
msg = MsgBox("Would you like to look up another branch?", vbYesNo)
Loop While msg = vbYes
End Sub
matter what I try I can't get it to work. Please help!
Sub GetAnswer()
' Created by CJ
'Enter an abbreviation and this will tell you which branch it is for.
Dim Num As Variant
Dim Answer As Variant
Dim msg As String
Dim Ans As Variant
Dim Nums As Variant
'Prompt for a value
Do
Num = InputBox("What is the branch number you would like to look up?")
'Exit if cancelled
If Num = "" Then Exit Sub
'Look up the abbreviation and return an answer.
Answer = Application.VLookup(Num, "Branch Numbers", 4, False)
MsgBox Answer
'Show which branch the number goes to
MsgBox Num & " is the PDSN Branch #" & Answer & "."
'Ask if they would like to look up another number
msg = MsgBox("Would you like to look up another branch?", vbYesNo)
Loop While msg = vbYes
End Sub