Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default code problem

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 a 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"???
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default code problem

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

--
Regards,
Tom Ogilvy



"scrabtree23" wrote in message
...
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 a 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"???



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 47
Default code problem

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


-----Original Message-----
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

--
Regards,
Tom Ogilvy



"scrabtree23" wrote

in message
...
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 a 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"???


.

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
Code problem puiuluipui Excel Discussion (Misc queries) 3 July 3rd 09 07:27 PM
Alt Code Problem aftamath77 Excel Discussion (Misc queries) 2 February 10th 09 11:42 PM
problem with this code Travis Excel Programming 1 January 28th 04 05:43 PM
problem with code gareth Excel Programming 1 December 5th 03 03:24 PM
Code problem Rick[_11_] Excel Programming 1 August 8th 03 04:25 AM


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