View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Peter T Peter T is offline
external usenet poster
 
Posts: 5,600
Default Strings not comparable??

If I follow you have "L" in two variables which fail to return true if
compared. It does seem odd so as a first step verify the strings in each
variable are truly the same.

In your procedure declare
Dim bArr() as byte

Put a break at the point you think the two var's should be the same, step
through and do this

bArr = k
'look in locals
bArr = sKuerzel
'look in locals

Press alt-v,s to look in Locals, expand and examine bArr
I would expect to see bArr(0) = 76, bArr(1) = 0 for each string = "L"

Regards,
Peter T






"Marco Bandner" wrote in message
ps.com...
Hi Peter,

bound = UBound(Daten) - 1
For index = 0 To bound


Why the -1.


At moment of coding I thought, array are indexed from 0 to n-1 (n =
ubound). You can ignore that regarding my problem.

Could it be you are failing to find a match in Daten(UBound)


Definetely no - to test my code (and this example of the problem case),
first I insert all values into that array, I want to find. While
debugging line for line, the VBA IDE shows me
at line "If k = sKuerzel And m = sMass Then" that k and sKuerzel
contain the same(!) values. Nevertheless comparising delivers "false"
for that case that k = sKuerzel = "L". I don't understand that.

Has anybody an idea??

Regards, Marco