C
Corey
Code 1 lists a value in a sheet that in Column A.
Code lists the value that are Offset from that Value cell : Offset(2,2) -
Offset(22,2). ((using the For i To22 line)).
When a value oin the Code 2 has been displayed/used the FONT changes to
Strikethrough.
An the subsequent Strikethough value are then No longer listed in the
Combobox6(code2) list.
But i want to set the Combobox5 (Code1) to NO longer list a value IF ALL the
values between .Offset(2,2) - .Offset(22,2) are strikethough.
If there is NO values to select from in Combobox6(code2) then there is NO
point having the Initial value listed in Combobox5(code1) then is there ?
How can i a chieve this ????
Corey....
~~~~~~~~~~~~~~~~~~ Code 1 ~~~~~~~~~~~~~~~
Private Sub ComboBox5_DropButtonClick()
'Application.ScreenUpdating = False
If ComboBox5.ListCount > 0 Then Exit Sub
Dim LastCell As Long
Dim myrow As Long
On Error Resume Next
LastCell = Worksheets("InspectionData").Cells(Rows.Count, "A").End(xlUp).Row
With ActiveWorkbook.Worksheets("InspectionData")
..Select 'first thing to do with a With statement that occurs on a second
sheet
For myrow = 2 To LastCell
If .Cells(myrow, 1) <> "" Then
If .Cells(myrow, 1).Offset(-1, 2).Text = ComboBox28.Text And
..Cells(myrow, 1).Offset(-1, 6).Text = ComboBox1.Text And
IsNumeric(Trim(Mid(.Cells(myrow, 1), 2))) = True Then
ComboBox5.AddItem Cells(myrow, 1)
End If
End If
Next
End With
End Sub
~~~~~~~~~ Code 2 ~~~~~~~~~~~~~~~~~~~~~~
Application.ScreenUpdating = False
If ComboBox6.ListCount > 0 Then Exit Sub
'Place the References in here for the Roll Numbers and Lengths
Dim LastCell As Long
Dim myrow As Long
On Error Resume Next
LastCell = Worksheets("InspectionData").Cells(Rows.Count,
"A").End(xlUp).Row
With ActiveWorkbook.Worksheets("InspectionData")
For myrow = 2 To LastCell
If .Cells(myrow, 1) <> "" Then
If .Cells(myrow, 1).Offset(-1, 2).Text = ComboBox28.Text And
..Cells(myrow, 1).Offset(-1, 6).Text = ComboBox1.Text And .Cells(myrow,
1).Offset(0, 0).Value = ComboBox5.Text And IsNumeric(Trim(Mid(.Cells(myrow,
1), 2))) = True Then
For i = 2 To 22
If Cells(myrow, 3).Offset(i, 0).Font.Strikethrough =
False And Cells(myrow, 3).Offset(i, 0).Value <> "" Then ' ONLY lists values
NOT Strikethrough or value=""
ComboBox6.AddItem Cells(myrow, 3).Offset(i, 0)
ComboBox6.List(ComboBox6.ListCount - 1, 1) = Cells(myrow, 3).Offset(i,
0).Address
End If
Next i
End If
End If
Next
End With
Application.ScreenUpdating = True
Code lists the value that are Offset from that Value cell : Offset(2,2) -
Offset(22,2). ((using the For i To22 line)).
When a value oin the Code 2 has been displayed/used the FONT changes to
Strikethrough.
An the subsequent Strikethough value are then No longer listed in the
Combobox6(code2) list.
But i want to set the Combobox5 (Code1) to NO longer list a value IF ALL the
values between .Offset(2,2) - .Offset(22,2) are strikethough.
If there is NO values to select from in Combobox6(code2) then there is NO
point having the Initial value listed in Combobox5(code1) then is there ?
How can i a chieve this ????
Corey....
~~~~~~~~~~~~~~~~~~ Code 1 ~~~~~~~~~~~~~~~
Private Sub ComboBox5_DropButtonClick()
'Application.ScreenUpdating = False
If ComboBox5.ListCount > 0 Then Exit Sub
Dim LastCell As Long
Dim myrow As Long
On Error Resume Next
LastCell = Worksheets("InspectionData").Cells(Rows.Count, "A").End(xlUp).Row
With ActiveWorkbook.Worksheets("InspectionData")
..Select 'first thing to do with a With statement that occurs on a second
sheet
For myrow = 2 To LastCell
If .Cells(myrow, 1) <> "" Then
If .Cells(myrow, 1).Offset(-1, 2).Text = ComboBox28.Text And
..Cells(myrow, 1).Offset(-1, 6).Text = ComboBox1.Text And
IsNumeric(Trim(Mid(.Cells(myrow, 1), 2))) = True Then
ComboBox5.AddItem Cells(myrow, 1)
End If
End If
Next
End With
End Sub
~~~~~~~~~ Code 2 ~~~~~~~~~~~~~~~~~~~~~~
Application.ScreenUpdating = False
If ComboBox6.ListCount > 0 Then Exit Sub
'Place the References in here for the Roll Numbers and Lengths
Dim LastCell As Long
Dim myrow As Long
On Error Resume Next
LastCell = Worksheets("InspectionData").Cells(Rows.Count,
"A").End(xlUp).Row
With ActiveWorkbook.Worksheets("InspectionData")
For myrow = 2 To LastCell
If .Cells(myrow, 1) <> "" Then
If .Cells(myrow, 1).Offset(-1, 2).Text = ComboBox28.Text And
..Cells(myrow, 1).Offset(-1, 6).Text = ComboBox1.Text And .Cells(myrow,
1).Offset(0, 0).Value = ComboBox5.Text And IsNumeric(Trim(Mid(.Cells(myrow,
1), 2))) = True Then
For i = 2 To 22
If Cells(myrow, 3).Offset(i, 0).Font.Strikethrough =
False And Cells(myrow, 3).Offset(i, 0).Value <> "" Then ' ONLY lists values
NOT Strikethrough or value=""
ComboBox6.AddItem Cells(myrow, 3).Offset(i, 0)
ComboBox6.List(ComboBox6.ListCount - 1, 1) = Cells(myrow, 3).Offset(i,
0).Address
End If
Next i
End If
End If
Next
End With
Application.ScreenUpdating = True