code problem

S

scrabtree23

Here is my code:

Private Sub cmbcc_Exit(ByVal Cancel As
MSForms.ReturnBoolean)
CCFCLC.cmbfc.Clear
Worksheets("CodeGrid").Activate
Range("A1").Select
Do While True And ActiveCell.Row <> 75
If Worksheets("Coding").Range("A1").Value =
ActiveCell.Value Then
Exit Do
End If
ActiveCell.Offset(1, 0).Select
Loop
If Worksheets("Coding").Range("A1").Value <>
ActiveCell.Value Then
Exit Sub
End If
ActiveCell = ActiveCell.Offset(0, 1).Select
Do While ActiveCell.Column <> 50
If ActiveCell.Value <> "" And LCase
(ActiveCell.Value) <> "no" Then
CCFCLC.cmbfc.AddItem ActiveCell.Value
End If
ActiveCell.Offset(0, 1).Select
Loop

End Sub

My problems are: 1) it makes the first drop down option "-
1"????

It changes the first value in the appropriate
cooresponding column on the "CodeGrid" sheet to "True"???
 
T

Tom Ogilvy

Private Sub cmbcc_Exit(ByVal Cancel As MSForms.ReturnBoolean)
CCFCLC.cmbfc.Clear
Worksheets("CodeGrid").Activate
Range("A1").Select
Do While True And ActiveCell.Row <> 75
If Worksheets("Coding").Range("A1").Value = _
ActiveCell.Value Then
Exit Do
End If
ActiveCell.Offset(1, 0).Select
Loop
If Worksheets("Coding").Range("A1").Value <> _
ActiveCell.Value Then
Exit Sub
End If
ActiveCell.Offset(0, 1).Select
Do While ActiveCell.Column < 50
If ActiveCell.Value <> "" And _
LCase(ActiveCell.Value) <> "no" Then
CCFCLC.cmbfc.AddItem Cells(1, _
ActiveCell.Column).Value
End If
ActiveCell.Offset(0, 1).Select
Loop
End Sub

Worked for me as I understand your layout. Assume you want to load the
value from row 1 into the second combobox for cells in the selected row that
are not blank and don't contain "no"

If you want to load the values from the cells in the select row for those
conditions change

CCFCLC.cmbfc.AddItem Cells(1, _
ActiveCell.Column).Value

to

CCFCLC.cmbfc.AddItem ActiveCell.Value
 
S

scrabtree

I think that finally got it. I may have more questions as
I develop this further. We shall see.
 

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

Top