additional help

S

scrabtree23

The two lines below are producing errors? I deleted the
first line and re-ran and the second line gave error?

With Worksheets("CCFCOK")
Set rng = .Range(.Cells(1, 1), .Cells(Rows.Count,
1).End(xlUp))
Set rng = rng(CCFCLC.cmbcc.ListIndex + 1)
End With

* CCFCLC.cmbfc.Clear
Set cell = rng.Offset(0, 1)
Do While Not IsEmpty(cell)
If LCase(cell.Value) = "yes" Then
* CCFCLC.cmbfc.AddItem cell.Parent.Cells(1,
cell.Column).Value
End If
Set cell = cell.Offset(0, 2)
Loop
 
T

Tom Ogilvy

Dim cbox1 as msforms.combobox
dim cbox2 as msforms.combobox
With Worksheets("CCFCOK")
set cbox1 = .OleObjects("cmbcc").Object
set cbox2 = .OleObjects("cmbfc").Object
Set rng = .Range(.Cells(1, 1), .Cells(Rows.Count, _
1).End(xlUp))
Set rng = rng(cbox1.ListIndex + 1)
End With

cbox2.clear
Set cell = rng.Offset(0, 1)
Do While Not IsEmpty(cell)
If LCase(cell.Value) = "yes" Then
cbox2.AddItem cell.Parent.Cells(1, _
cell.Column).Value
End If
Set cell = cell.Offset(0, 2)
Loop

Make sure the combobox has an OleObject name of cmbfc for the 2ndbox and
cmbcc for the first box.

go into design mode and click on the combobox. Look in the name box.
Assumes both boxes are on sheet CCFCOK
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top