Excel 2007
I have a VBA procedure for checking a selection (Country) to determine an action.
Under Option Explicit I have declared Public strCountry as String.
As part of the procedure I am asking "If strCountry is XYZ Then Do this (etc). If not do something else.
For some reason within the procedure I am able to identify the user section, but unable to use it in a call to action.
For example, under a Public Function:
In the subject worksheet the user has selected "Australia" (without the quotes.)
strCountry = Worksheets("1-REVENUES").Range("lstCountry").Value
Msgbox strCountry '[returns "Australia" (without the quotes)]
MsgBox Worksheets("1-REVENUES").Range("lstCountry").Value '[returns "Australia" (without the quotes)]
MsgBox strCountry = Worksheets("1-REVENUES").Range("lstCountry").Value '[returns FALSE] ??
The following (paraphrased)
If strCountry = "Australia" Then
[Do This]
End If
[Do something else]
results in [Do something else].
Why is the call not recognising the string "Australia"?? (or any other string for that matter)
Any help appreciated.
Bookmarks