Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Jay Jay is offline
external usenet poster
 
Posts: 671
Default Deleting all items from Combobox

Hello all,

I'm writing a function to remove items from a combobox, but I've run into a
problem that I can't seem to get around. Hoping someone can help me out.

Problem:
I have a combobox on an excel form. It contains the names of a specific
range of worksheets in the workbook. When a selection is made (combox is
changed), the combobox.value is the name of a worksheet. This value is used
to modify the data source of a chart.

The problem is, when I run the update function to update the worksheet list
for the comboboxes, I remove all the existing items, and then add the updated
worksheet list. This RemoveItem also runs the _Change function of the
combobox. This is where my problem is. I don't want _Change to run, I just
want all the values removed.

Any ideas are appreciated. If I've described that poorly, let me know and
I'll try again.

Thanks,
Jay

  #2   Report Post  
Posted to microsoft.public.excel.programming
Jay Jay is offline
external usenet poster
 
Posts: 671
Default Deleting all items from Combobox

Not the most perfect solution, but I've found a way around it.

Instead of using cbo.RemoveItem and looping through each item, I used
cbo.Clear.

In the _Change event, I check if cbo.value = "". If it does = "", then do
nothing, otherwise, do the usual function call.

Jay

"Jay" wrote:

Hello all,

I'm writing a function to remove items from a combobox, but I've run into a
problem that I can't seem to get around. Hoping someone can help me out.

Problem:
I have a combobox on an excel form. It contains the names of a specific
range of worksheets in the workbook. When a selection is made (combox is
changed), the combobox.value is the name of a worksheet. This value is used
to modify the data source of a chart.

The problem is, when I run the update function to update the worksheet list
for the comboboxes, I remove all the existing items, and then add the updated
worksheet list. This RemoveItem also runs the _Change function of the
combobox. This is where my problem is. I don't want _Change to run, I just
want all the values removed.

Any ideas are appreciated. If I've described that poorly, let me know and
I'll try again.

Thanks,
Jay

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
Combobox items determined by the selection in another combobox Alerion Excel Programming 2 September 13th 06 01:07 PM
how to add items to combobox Marek Excel Programming 3 August 30th 04 10:31 AM
add a range of items to a combobox spence[_3_] Excel Programming 2 January 14th 04 05:59 AM
ComboBox Items Todd Huttenstine[_2_] Excel Programming 1 December 14th 03 11:12 PM
ComboBox items Keith Willshaw Excel Programming 2 July 17th 03 11:22 AM


All times are GMT +1. The time now is 05:44 AM.

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"