Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Vba excel - Combo box question - erasing value


Hi all,

I have a combo box full of data. One of the data is "<New Item".
want to locate, and erase that value from the list.
I am trying the code below, but getting sintax error.
Can anybody help? Thanks in advance, Aldo.

For c1 = 0 To ComboBox.ListCount
If ComboBox.Value(c1) = "<New Item" Then
ComboBox(c1).clear
exit for
End If
Next c

--
ajliak
-----------------------------------------------------------------------
ajliaks's Profile: http://www.excelforum.com/member.php...nfo&userid=819
View this thread: http://www.excelforum.com/showthread.php?threadid=27450

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Vba excel - Combo box question - erasing value

For c1 = 0 To ComboBox.ListCount - 1
If Instr(1,ComboBox.List(c1) ,"<New Item",vbTextcompare) Then
ComboBox.RemoveItem c1
exit for
End If
Next c1

--
Regards,
Tom Ogilvy

"ajliaks" wrote in message
...

Hi all,

I have a combo box full of data. One of the data is "<New Item". I
want to locate, and erase that value from the list.
I am trying the code below, but getting sintax error.
Can anybody help? Thanks in advance, Aldo.

For c1 = 0 To ComboBox.ListCount
If ComboBox.Value(c1) = "<New Item" Then
ComboBox(c1).clear
exit for
End If
Next c1


--
ajliaks
------------------------------------------------------------------------
ajliaks's Profile:

http://www.excelforum.com/member.php...fo&userid=8196
View this thread: http://www.excelforum.com/showthread...hreadid=274501



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
Erasing Recent Documents History on Excel LadyM Excel Discussion (Misc queries) 2 February 8th 10 07:57 PM
Erasing a excel file Tim Excel Discussion (Misc queries) 1 February 28th 06 03:02 AM
Erasing Outlook Calendar from within Excel littlegreenmen1 Excel Discussion (Misc queries) 0 June 15th 05 05:23 PM
eXceL 2003 - list or combo box question David Gerstman Excel Discussion (Misc queries) 2 May 23rd 05 03:58 PM
Excel 2000: Combo box cell link protection question Bertus Theron Excel Programming 0 June 22nd 04 11:05 PM


All times are GMT +1. The time now is 11:47 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"