Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default how to add new items to a list

I have created a drop down box in page 1 of a spreadsheet. The list it refers
to is in page 2 of the same workbook. I want users to be able to pick form
the already defined list from the drop down box but in case where there is
something new not on the list, I need users to be able to free type into the
cell.

Any ideas how to do this? thanks
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,058
Default how to add new items to a list

Instruct your users to disable the data validation to enter free text.
--
Gary''s Student - gsnu200783
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,073
Default how to add new items to a list

On May 2, 8:57 pm, peter pan <peter
wrote:
I have created a drop down box in page 1 of a spreadsheet. The list it refers
to is in page 2 of the same workbook. I want users to be able to pick form
the already defined list from the drop down box but in case where there is
something new not on the list, I need users to be able to free type into the
cell.

Any ideas how to do this? thanks


Deselect the "Show error alert after invalid data is entered" option
on the "Error Alert" tab of the "Data Validation" dialog, then
unlisted entries are accepted.

If you want the new entries added to the drop down list then use a
Worksheet_Change event procedure to do that. For example, say the list
is a dynamic named range named MyList and the data is entered in D1,
then something like...

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("D1")) Is Nothing Then
On Error GoTo ERROR_HANDLER
If WorksheetFunction.CountIf(Range("MyList"), Target.Value) = 0
Then
Application.EnableEvents = False
Range("MyList").Offset(Range("MyList").Cells.Count , 0) _
.Cells(1).Value = Target.Value
Application.EnableEvents = True
End If
End If
Exit Sub
ERROR_HANDLER: Application.EnableEvents = True
End Sub

Ken Johnson






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
Matching items in 2 list to consolidate to one list hot dogs Excel Discussion (Misc queries) 2 April 25th 07 04:01 PM
last 20 items in a list Ian G Excel Worksheet Functions 4 February 7th 06 09:53 PM
How do I delete items in one list from another list? Danielle Excel Discussion (Misc queries) 4 December 13th 05 02:32 AM
named range, data validation: list non-selected items, and new added items KR Excel Discussion (Misc queries) 1 June 24th 05 05:21 AM
sum particular items from a list Jeff Excel Discussion (Misc queries) 3 March 1st 05 03:50 PM


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