View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
James James is offline
external usenet poster
 
Posts: 542
Default Add item to combobox in sheet

Hi everyone. I need to add items to a combobox with the following criteria
p.s. the names of the comboboxes are cb1, cb2, cb3 etc. and the cb's are on
the worksheet, not in a userform.
also, do i need to set rng every time i activate a diff sheet? just wondering
Any Help would be great! Thanks

Public Sub SearchUnstamped()
Dim rng As Range
Dim n As Integer
Dim i As Integer
Dim j As Integer

Set rng = Range("G6:G100")
j = 1
n = ThisWorkbook.Worksheets.Count

For i = 5 To n
Sheets(i).Activate
j = j + 1
For Each cel In rng
If cel.Value = "" Then
If Cells(cel.Row, 1).Value < "" Then
If cel.Interior.ColorIndex < 15 Then
'Something like - cb(j).additem = Cells(cel.row,
1).value
'I need this section to take the value of column A
and add
'it to the combobox.
End If
End If
End If
Next
Next
end sub