Variable value???

User avatar
ErikJan
BronzeLounger
Posts: 1254
Joined: 03 Feb 2010, 19:59
Location: Terneuzen, the Netherlands

Variable value???

Post by ErikJan »

Dim T as string

I run my code, and stop it, then I try to see what the value of my variable "T" is... This is from the immediate window in the VBA editor in Excel:

? asc(T)
63
? chr(63)=T
False
? len(T)
1

What am I not seeing?

User avatar
HansV
Administrator
Posts: 78545
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Variable value???

Post by HansV »

If T is a Unicode character > Chr(255), Asc(T) will return 63 and Len(T) will return 1, but T will not equal Chr(63).
Best wishes,
Hans

User avatar
ErikJan
BronzeLounger
Posts: 1254
Joined: 03 Feb 2010, 19:59
Location: Terneuzen, the Netherlands

Re: Variable value???

Post by ErikJan »

OK, so how do I test if T is that value?

User avatar
ErikJan
BronzeLounger
Posts: 1254
Joined: 03 Feb 2010, 19:59
Location: Terneuzen, the Netherlands

Re: Variable value???

Post by ErikJan »

ASCW, sorry... found it, thanks