Re: Which variable to use?

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: NickHK (TungCheWah_at_Invalid.com)
Date: 11/23/04


Date: Tue, 23 Nov 2004 12:16:24 +0800

Rachael,
I suspect your problem is from the type coercion (<number> to string) that
occurs when you use .AddItem.
Read the combobox value leaves it as a string, which is maybe not what you
want in your criteria.
Try CLng or CDbl to get the <number> back.

NickHK

"rach85" <rach85.1g5mba@excelforum-nospam.com> wrote in message
news:rach85.1g5mba@excelforum-nospam.com...
>
> sorry abt that..here it is:
>
> Set Coll = New Collection
>
> With ComboBox1
> Clear
>
> For Each cell In Range("A2:A65000")
>
> If cell.Value <> "" Then
> Err.Clear
> Coll.Add cell.Value, cell.Value
> If Err.Number = 0 Then .AddItem cell.Value
> End If
>
> Next cell
>
> End With
>
>
> --
> rach85
> ------------------------------------------------------------------------
> rach85's Profile:
http://www.excelforum.com/member.php?action=getinfo&userid=16557
> View this thread: http://www.excelforum.com/showthread.php?threadid=319567
>


Quantcast