Hi,
I have written an "if then else" statement in VBA for Excel XP.
FR3, FR2 and FormL are String Variables
If FR3 = "$" Then
If FR2 > "M" Then
FormL = "N"
Else
FormL = "L"
End If
GoTo Skip_2nd_Test
End If
Assume FR3 = "$"
The problem is: if FR2 is defined as "a" or any letter that should be less than "M", or FALSE, it still falls through as TRUE. I can't figure it out. As I am stepping through the macro, I can put my cursor over the value and it will display what the computer sees it as. And it clearly shows FR2 = "a" and it compares it to "M", but still drops down to FormL = "N" instead of "L".
The same statements put in spreadsheet form work fine. Do you have any Ideas?
Thank you
Dan S.
dshinkel@tucsonelectric.com
I have written an "if then else" statement in VBA for Excel XP.
FR3, FR2 and FormL are String Variables
If FR3 = "$" Then
If FR2 > "M" Then
FormL = "N"
Else
FormL = "L"
End If
GoTo Skip_2nd_Test
End If
Assume FR3 = "$"
The problem is: if FR2 is defined as "a" or any letter that should be less than "M", or FALSE, it still falls through as TRUE. I can't figure it out. As I am stepping through the macro, I can put my cursor over the value and it will display what the computer sees it as. And it clearly shows FR2 = "a" and it compares it to "M", but still drops down to FormL = "N" instead of "L".
The same statements put in spreadsheet form work fine. Do you have any Ideas?
Thank you
Dan S.
dshinkel@tucsonelectric.com