Setting variables as integers or strings?
Posted on 2007-04-05
I am trying to set up variables, and then run if statements using the variables. The problem that I am coming up with is VarC can be text or numbers and I am declaring them as strings. Therfore, the following is happening:
Assume VarA is 1 and VarC is 10
Assume r.Offset(0, VarA).Value = 5
Dim VarA(1 To 8) As String, VarC(1 To 8) As String
If r.Offset(0, VarA).Value < VarC Then ...
Because VarC is a string, it is not accepting 10 as an integer, but as text:
(If 5 < "10" then ...)
How do I get around this...?