Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 812
Default Help needed - populating comboboxes from list??

Here is code for the UserForm to populate ComboBox1. I leave ComboBox2
for you. Use the Properties Window to set the ColumnCount and
ColumnWidths properties. I set ColumnHeads to False. It may not be
possible to use column headings when you are skipping some columns and
rows in the source area.

Private Sub UserForm_Activate()
Dim rng As Range
Dim iRow As Integer
Dim iCt As Integer

iRow = Sheets("Sheet1").Range("A1").End(xlDown).Row
Set rng = Sheets("Sheet1").Range("A2:A" & iRow)
For Each c In rng
If c.Offset(0, 4) < "" And c.Offset(0, 5) = "" Then
iCt = iCt + 1
ComboBox1.AddItem c
ComboBox1.Column(1, iCt - 1) = c.Offset(0, 2)
ComboBox1.Column(2, iCt - 1) = c.Offset(0, 3)
End If
Next c
End Sub

HTH,
Merjet

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
.AddItem list and populating combobox with created list pallaver Excel Discussion (Misc queries) 8 June 27th 08 12:36 PM
Populating Comboboxes nannon8 Excel Programming 2 January 11th 07 09:29 AM
populating list Wazooli Excel Programming 4 March 7th 05 10:50 PM
Populating dropdown list 2 with data depending upon what was selected in list 1 karambos Excel Programming 2 November 9th 04 05:32 PM
Populating ComboBoxes WIlliam Barnes Excel Programming 2 February 29th 04 11:26 AM


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