View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 6,953
Default When true isn't true - help for newbie

Easier to check the ListIndex property

if x.ListIndex = -1 then
x.ListIndex = x.listcount - 1
else
msgbox "Item is in list"
End if

I don't think putting double qoutes on "False" will help since you declared
itfits as boolean and not string.
--
Regards,
Tom Ogilvy


"m.s.w" wrote:

Gary Keramidas wrote:
just a guess, but what happens when you put quotes around true and false?

ItFits = "False"

Thanks for your advise but it's not the case.
It looks, that even when X.Value is eqal to lets say X.List(4) (both
values are the same) the "If X.Value = X.List(K) Then..." is not run.
Like the values would be not equal.

m.s.w