I have a line of VBA code that should be returning TRUE but doesn't... does anybody have any thoughts as to why this could be?
I have added a watch to "Left(Range("Y" & a).Value,1) and roll_day. At the time the comparison is supposed to be done the Left(...) command shows the content as "9" and roll_day is showing as 9, yet the code doesn't go into the Then clause.
Any thoughts as to why this may be?
roll_day is a simple variable that has been defined as Range("AF5").Value
The cells in the Y column that this code cycles through are defined earlier as "Range("AF4").Value & "th " & Range("AG4").Value [essentially taking two input fields and turning them into a written date]
Code:
If Left(Range("Y" & a).Value,1) = roll_day Then ...
I have added a watch to "Left(Range("Y" & a).Value,1) and roll_day. At the time the comparison is supposed to be done the Left(...) command shows the content as "9" and roll_day is showing as 9, yet the code doesn't go into the Then clause.
Any thoughts as to why this may be?
roll_day is a simple variable that has been defined as Range("AF5").Value
The cells in the Y column that this code cycles through are defined earlier as "Range("AF4").Value & "th " & Range("AG4").Value [essentially taking two input fields and turning them into a written date]