Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Combobox - add manual entry to future list

Another query,

When a user enters a manual entry into the combobox on my userform
want the userform to ask if this entry should be added to the drop-dow
list for future use.

I can manage most of this but I don't know what the statement would b
for determining if the manual entry is in the existing list or not.

if combobox1.value = 'one not in source list' then
call userform2 etc

Can anyone help

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Combobox - add manual entry to future list

Same as any other type of comparison. You would loop through the list and
see if the value of the combobox matches any entry in the list. There is
not built in setting or attribute that will tell you that information.

You can also avoid a loop by using the worksheet Match function.

--
Regards,
Tom Ogilvy

"cornishbloke " wrote in
message ...
Another query,

When a user enters a manual entry into the combobox on my userform I
want the userform to ask if this entry should be added to the drop-down
list for future use.

I can manage most of this but I don't know what the statement would be
for determining if the manual entry is in the existing list or not.

if combobox1.value = 'one not in source list' then
call userform2 etc

Can anyone help?


---
Message posted from http://www.ExcelForum.com/



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Combobox - add manual entry to future list

Hi Tom,

This would be the first time that I've needed to use a loop, so I'm not
sure how to do what you suggest. Assuming my list is in cells A1:A10
and is named "ContList" how would I use loop through to check if the
value of ContCombobox matches any in this range?

Thank you for your patience!


---
Message posted from http://www.ExcelForum.com/

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Combobox - add manual entry to future list

Dim cell as range
Dim bMatch as boolean
Dim ans as Variant
for each cell in Range("ContList")
if lcase(trim(cell.value) = me.Combobox1.Value then _
bMatch = True
exit for ' found, no need to continue checking
End if
Next
if not bMatch then
ans = msgbox( "Add " & me.Combobox1.Value & " to list?", vbYesNo)
if ans = vbYes then
' add to list
end if
End if

--
Regards,
Tom Ogilvy

"cornishbloke " wrote in
message ...
Hi Tom,

This would be the first time that I've needed to use a loop, so I'm not
sure how to do what you suggest. Assuming my list is in cells A1:A10
and is named "ContList" how would I use loop through to check if the
value of ContCombobox matches any in this range?

Thank you for your patience!


---
Message posted from http://www.ExcelForum.com/



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
"What-if" formula for either a manual entry and automated entry MZ Excel Discussion (Misc queries) 3 February 3rd 10 10:29 PM
Creating a list with entries from cells and manual entry too Rims Excel Discussion (Misc queries) 2 August 26th 08 08:58 AM
space left for future entry = #DIV/0! clooney New Users to Excel 3 May 24th 06 02:46 PM
Preventing manual entry in dropdown list ... possible? Maurice Excel Discussion (Misc queries) 4 March 21st 06 06:56 PM
Manual or Formula entry in cell. Naz Excel Discussion (Misc queries) 0 May 24th 05 10:44 PM


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