Logo 
Search:

MS Office Answers

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds
  Question Asked By: Kenneth Bennett   on Jan 11 In MS Office Category.

  
Question Answered By: Zachary Bouchard   on Jan 11

It looks to me as though you are using string  variables to hold numbers.
Remember that a number held in a string variable  is checked by alpha characters,
from the left. For instance, in string variables, "2" will be greater than
"1000000".

Use numeric variables for numbers (Integer is fine if the numbers are integral
and small enough). Just give your initial value as something much larger than
the biggest number you're likely to encounter.

But why not use the Min function  and save all the hassle? If your version of
Excel doesn't have one in VBA (e.g. Office 95 or 97) then you can use the one
from Excel itself.

Share: 

 

This Question has 13 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on Help with Value in a Variable Or get search suggestion and latest updates.


Tagged: