Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 26
Default Dynamically Building List

I have seen how you can build a combo box in a cell by going to
Data...Validation...Allow:List and using a named range to define a list.
But this list cannot change with some management by removing the named range
and inserting or removing data from the range, and then naming the range
again. I wish to make it easy for a user to paste a column of data into the
same range, and then have that take automatically in the combo box list. Any
ideas on clever ways to do this? Can I build the list dynamically using vba
..AddItem, or some other way?


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 367
Default Dynamically Building List

You can build the range dinamically.

look at this thread, thereis a similar problem:
http://groups.google.com/group/micro...39ab413df2e6d#

hth

Carlo

On Dec 27, 10:56*am, "Derek Hart" wrote:
I have seen how you can build a combo box in a cell by going to
Data...Validation...Allow:List and using a named range to define a list.
But this list cannot change with some management by removing the named range
and inserting or removing data from the range, and then naming the range
again. *I wish to make it easy for a user to paste a column of data into the
same range, and then have that take automatically in the combo box list. Any
ideas on clever ways to do this? *Can I build the list dynamically using vba
.AddItem, or some other way?


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 695
Default Dynamically Building List

Put this in ur sheet-module where u have the list
Dropdown is inserted on Sheet1 C1 - change to fit

Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Range("A1:A9000")) Is Nothing Then Exit Sub
Dim t, List
For t = 1 To Cells(9000, 1).End(xlUp).Row
If Cells(t, 1) < "" Then List = List & "," & Cells(t, 1)
Next
With Sheets("Sheet1").Range("C2").Validation ' where the dropdown will bee
present
.Delete
.Add xlValidateList, Formula1:=List
.InCellDropdown = True
End With
End Sub



"Derek Hart" skrev:

I have seen how you can build a combo box in a cell by going to
Data...Validation...Allow:List and using a named range to define a list.
But this list cannot change with some management by removing the named range
and inserting or removing data from the range, and then naming the range
again. I wish to make it easy for a user to paste a column of data into the
same range, and then have that take automatically in the combo box list. Any
ideas on clever ways to do this? Can I build the list dynamically using vba
..AddItem, or some other way?



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 26
Default Dynamically Building List

OK, I have two lists in a worksheet. After one item is chosen from the combo
list, I wish to set new data into the next list in the next column. Do these
combo lists have an after update event, or is there some way to do this?

Derek


"excelent" wrote in message
...
Put this in ur sheet-module where u have the list
Dropdown is inserted on Sheet1 C1 - change to fit

Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Range("A1:A9000")) Is Nothing Then Exit Sub
Dim t, List
For t = 1 To Cells(9000, 1).End(xlUp).Row
If Cells(t, 1) < "" Then List = List & "," & Cells(t, 1)
Next
With Sheets("Sheet1").Range("C2").Validation ' where the dropdown will
bee
present
.Delete
.Add xlValidateList, Formula1:=List
.InCellDropdown = True
End With
End Sub



"Derek Hart" skrev:

I have seen how you can build a combo box in a cell by going to
Data...Validation...Allow:List and using a named range to define a list.
But this list cannot change with some management by removing the named
range
and inserting or removing data from the range, and then naming the range
again. I wish to make it easy for a user to paste a column of data into
the
same range, and then have that take automatically in the combo box list.
Any
ideas on clever ways to do this? Can I build the list dynamically using
vba
..AddItem, or some other way?





  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 367
Default Dynamically Building List

Hey Derek

could you give us a small example how your list looks like?
It would improve the quality of the answers a lot.

cheers

Carlo

On Dec 28, 3:20*am, "Derek Hart" wrote:
OK, I have two lists in a worksheet. After one item is chosen from the combo
list, I wish to set new data into the next list in the next column. Do these
combo lists have an after update event, or is there some way to do this?

Derek

"excelent" wrote in message

...



Put this in ur sheet-module where u have the list
Dropdown is inserted on Sheet1 C1 - change to fit


Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Range("A1:A9000")) Is Nothing Then Exit Sub
Dim t, List
*For t = 1 To Cells(9000, 1).End(xlUp).Row
* *If Cells(t, 1) < "" Then List = List & "," & Cells(t, 1)
*Next
*With Sheets("Sheet1").Range("C2").Validation ' where the dropdown will
bee
present
* *.Delete
* *.Add xlValidateList, Formula1:=List
* *.InCellDropdown = True
*End With
End Sub


"Derek Hart" skrev:


I have seen how you can build a combo box in a cell by going to
Data...Validation...Allow:List and using a named range to define a list..
But this list cannot change with some management by removing the named
range
and inserting or removing data from the range, and then naming the range
again. *I wish to make it easy for a user to paste a column of data into
the
same range, and then have that take automatically in the combo box list..
Any
ideas on clever ways to do this? *Can I build the list dynamically using
vba
..AddItem, or some other way?- Hide quoted text -


- Show quoted text -


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
building list driller Excel Worksheet Functions 1 May 28th 07 04:11 PM
dynamically building references to named ranges [email protected] Excel Discussion (Misc queries) 1 January 3rd 06 10:23 PM
building a list in a col...based on another col KimberlyC Excel Programming 2 January 24th 05 10:59 PM
self-building dropdown list boris Excel Worksheet Functions 1 January 17th 05 05:33 PM


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