View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jake Marx[_3_] Jake Marx[_3_] is offline
external usenet poster
 
Posts: 860
Default How do I initialize a ComboList Box control from a range in an ex.

Hi ken,

ken wrote:
I am trying to write a simple data base application which displays for
selection a range of a spreadsheet. Trying to set RowSource from
properties or code. Never seem to be able to code the correct "type".


I'm not exactly clear what you're trying to accomplish, but the following
code will set the RowSource of a ComboBox (named "cboUsers" in this case) to
the range A1:A5 on Sheet1:

Private Sub UserForm_Initialize()
cboUsers.RowSource = "Sheet1!A1:A5"
End Sub

To do it at design time, you can set the property to Sheet1!A1:A5.

--
Regards,

Jake Marx
MS MVP - Excel
www.longhead.com

[please keep replies in the newsgroup - email address unmonitored]