Re: Which variable to use?
From: NickHK (TungCheWah_at_Invalid.com)
Date: 11/23/04
- Next message: Alan: "How do I save an embedded item from a work*** into a folder"
- Previous message: strataguru: "Re: find all text files in a directory"
- In reply to: rach85: "Re: Which variable to use?"
- Next in thread: rach85: "Re: Which variable to use?"
- Reply: rach85: "Re: Which variable to use?"
- Messages sorted by: [ date ] [ thread ]
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
>
- Next message: Alan: "How do I save an embedded item from a work*** into a folder"
- Previous message: strataguru: "Re: find all text files in a directory"
- In reply to: rach85: "Re: Which variable to use?"
- Next in thread: rach85: "Re: Which variable to use?"
- Reply: rach85: "Re: Which variable to use?"
- Messages sorted by: [ date ] [ thread ]