Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
I'm sure there's a simple answer, but for the moment I'm stuck and I have a deadline to meet. I have declared a three dimensional array as being of variant type and then assigned various values to the array. Some of the values assigned are numerical, some are strings. Part of my code compares the values in the array. When comparing values that contain numerical values there is no problem, yet when comparing values that are strings I get the type mismatch error. If one value was numerical and the other was a string I could understand why this is, however I have checked that the two values are both strings. Anyone know what I'm doing wrong? |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
if isnumeric(a) and isnumeric(b) then
if cdbl(a) = cdbl(b) then else end if elseif vartype(a) = 8 and vartype(b) = 8 then if a = b then else end if else ' they don't match end if -- Regards, Tom Ogilvy "jamiee" wrote in message om... Hi I'm sure there's a simple answer, but for the moment I'm stuck and I have a deadline to meet. I have declared a three dimensional array as being of variant type and then assigned various values to the array. Some of the values assigned are numerical, some are strings. Part of my code compares the values in the array. When comparing values that contain numerical values there is no problem, yet when comparing values that are strings I get the type mismatch error. If one value was numerical and the other was a string I could understand why this is, however I have checked that the two values are both strings. Anyone know what I'm doing wrong? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How to check a Variant for its data type | Excel Programming | |||
variant array containing cel adresses convert to actual ranges-array | Excel Programming | |||
Type mismatch? string 2 a long?? | Excel Programming | |||
setting ctl to array of checkboxes yields type mismatch error. | Excel Programming | |||
setting ctl to array of checkboxes yields type mismatch error. | Excel Programming |