Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Clear button adds to combo box lists


Hi all,
when I press the clear button on my user form it repopulates the
combo box list when I press the clear button.

For instance when I operate

Private Sub cmdClearForm_Click()

Call UserForm_Initialize

End Sub

It adds the same information again to my drop down lists. i.e I have 5
names, when I press the clear button once, I get ten names, this is
repaeted ad infinitum.

What am I doing wrong?

excel 2003 all updated on WinXP PRO

Thank you all.

ALan.


--
alann2
------------------------------------------------------------------------
alann2's Profile: http://www.excelforum.com/member.php...o&userid=37531
View this thread: http://www.excelforum.com/showthread...hreadid=572580

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Clear button adds to combo box lists

It sounds like you are using Additem. If so, you need to remove the existing
entires first.


Combobox1.Clear
for i = 1 to 5
Combobox1.AddItem "Item " & i
Next

as an example.

--
Regards,
Tom Ogilvy



"alann2" wrote:


Hi all,
when I press the clear button on my user form it repopulates the
combo box list when I press the clear button.

For instance when I operate

Private Sub cmdClearForm_Click()

Call UserForm_Initialize

End Sub

It adds the same information again to my drop down lists. i.e I have 5
names, when I press the clear button once, I get ten names, this is
repaeted ad infinitum.

What am I doing wrong?

excel 2003 all updated on WinXP PRO

Thank you all.

ALan.


--
alann2
------------------------------------------------------------------------
alann2's Profile: http://www.excelforum.com/member.php...o&userid=37531
View this thread: http://www.excelforum.com/showthread...hreadid=572580


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Clear button adds to combo box lists


The code that fills the list box add this to the top

list1.clear

This way it will clear it each time the code is calle

--
drawling
-----------------------------------------------------------------------
drawlings's Profile: http://www.excelforum.com/member.php...fo&userid=3662
View this thread: http://www.excelforum.com/showthread.php?threadid=57258

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Clear button adds to combo box lists


That was just what I needed.
No doubt I'll be calling on youor services again.
I only started Trying to Program Yesterday morning.

Alan.


--
alann2
------------------------------------------------------------------------
alann2's Profile: http://www.excelforum.com/member.php...o&userid=37531
View this thread: http://www.excelforum.com/showthread...hreadid=572580

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating a button in excel that adds one to a cell artie_p Excel Discussion (Misc queries) 2 August 28th 07 01:12 AM
Clear entries on Combo box casey Excel Discussion (Misc queries) 1 December 13th 06 02:37 AM
Clear unactive combo boxes [email protected] Excel Programming 2 September 23rd 05 08:09 PM
Macro to clear combo box values Carpie Excel Programming 4 September 9th 05 06:48 PM
How to clear all item from a combo box? 39N95W Excel Programming 8 July 19th 04 07:31 AM


All times are GMT +1. The time now is 08:19 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"