View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
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/