Hi,
I'm currently writing some code that subtracts the previous months activity YTD from the current months activity YTD to derive the current monthly activity.
Then, in my code, if the current months activity YTD figure is less than the previous months activity YTD figure (i.e. a negative number) it fills the row pink.
My problem is that there seems to be no logic to what is turning the row pink (i.e. the rows are turning pink in a random fashion).
My two variables iActThisMonth and iActLastMonth are defined as strings because I am using the returned "" value in later code.
But my question is, how does Excel VBA handle numerical calculations on numbers stored as text?
My thinking is that if my two variables iActThisMonth and iActLastMonth are defined as strings. Is my < operator still comparing numbers? Or is it comparing ASCI characters (or maybe somthing else).
Any advise or a nudge in the right direction would be much appreciated.
Thanks,
Roy
I'm currently writing some code that subtracts the previous months activity YTD from the current months activity YTD to derive the current monthly activity.
Then, in my code, if the current months activity YTD figure is less than the previous months activity YTD figure (i.e. a negative number) it fills the row pink.
My problem is that there seems to be no logic to what is turning the row pink (i.e. the rows are turning pink in a random fashion).
My two variables iActThisMonth and iActLastMonth are defined as strings because I am using the returned "" value in later code.
But my question is, how does Excel VBA handle numerical calculations on numbers stored as text?
My thinking is that if my two variables iActThisMonth and iActLastMonth are defined as strings. Is my < operator still comparing numbers? Or is it comparing ASCI characters (or maybe somthing else).
Any advise or a nudge in the right direction would be much appreciated.
Thanks,
Roy