Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default question about the ControlSource of a ComboBox

I have a column 'A' in my excel worksheet with the header 'Names' that
lists the names of all the people in a company (one name on each row).
Eg. A2 contains the data 'Bill', A3 contains 'Sal', A4 has 'Kim'
etc...

If I want a ComboBox to display all of these names I figured I could
modify the ControlSource property of the ComboBox by changing it to
something like 'Sheet1!A2' but that only adds the name in cell A2 to
the ComboBox. Is there any way to add the whole list of names to the
ComboBox? Note: the list of names keeps changing dynamically so I can't
do something like 'Sheet1!A2-A50'
Is there a way to reference the entire column?

Thanks for any help


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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default question about the ControlSource of a ComboBox

Hi

I try to explain a valuable way


Insert - Name - Define
For Name type (without quotation marks ): "Range_of_Name"
Refers to: =INDIRECT("Sheets1!A1A" &COUNTA(Sheets1!A:A)

...and add this Code into your Combobox

Private Sub Combobox1_GotFocus()
Me.Combobox1.ListfillRange = "Range_of_Name"
End Sub

Now you should get a whole List of names without blank fields :-)

Best regards from switzerland ;-

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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default question about the ControlSource of a ComboBox

many thanks for the quick reply!

:cool

--
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
ComboBox Question jlclyde Excel Discussion (Misc queries) 2 August 27th 09 09:31 PM
ComboBox Question Duncan Edment Excel Worksheet Functions 1 August 1st 06 12:42 PM
combobox Question Greg B Excel Discussion (Misc queries) 2 September 2nd 05 04:22 PM
ComboBox Question Kevin Excel Programming 1 December 7th 03 04:54 PM
Basic Userform Controlsource question Kevin Excel Programming 0 August 7th 03 11:04 PM


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