C
Corey
Private Sub ComboBox23_DropButtonClick()
Application.ScreenUpdating = False
If ComboBox23.ListCount > 0 Then Exit Sub
Dim lastcell As Long
Dim myrow As Long
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 = TextBox250.Text And
..Cells(myrow, 1).Offset(0, 0).Value = ComboBox2.Text And
IsNumeric(Trim(Mid(.Cells(myrow, 1), 2))) = True Then
For i = 2 To 22
If Cells(myrow, 3).Offset(i, 0).Value <> "" Then
ComboBox23.AddItem Cells(myrow, 3).Offset(i, 0)
ComboBox23.List(ComboBox23.ListCount - 1, 1) = Cells(myrow, 3).Offset(i,
0).Address
End If
Next i
End If
End If
Next
End With
Application.ScreenUpdating = True
End Sub
The above code populates a list into Combobox23.
What i want to do is gain the value of the cell (.Offset(0,7)) from the
value that WAS Selected in the Combobox.
I want:
Textbox2.value = Combobox23.Selection.Offset(0,7) ???????
I am sure i can add something here but it has avoided me getting it to work.
Can anyone see how to do this ?
Corey....
Application.ScreenUpdating = False
If ComboBox23.ListCount > 0 Then Exit Sub
Dim lastcell As Long
Dim myrow As Long
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 = TextBox250.Text And
..Cells(myrow, 1).Offset(0, 0).Value = ComboBox2.Text And
IsNumeric(Trim(Mid(.Cells(myrow, 1), 2))) = True Then
For i = 2 To 22
If Cells(myrow, 3).Offset(i, 0).Value <> "" Then
ComboBox23.AddItem Cells(myrow, 3).Offset(i, 0)
ComboBox23.List(ComboBox23.ListCount - 1, 1) = Cells(myrow, 3).Offset(i,
0).Address
End If
Next i
End If
End If
Next
End With
Application.ScreenUpdating = True
End Sub
The above code populates a list into Combobox23.
What i want to do is gain the value of the cell (.Offset(0,7)) from the
value that WAS Selected in the Combobox.
I want:
Textbox2.value = Combobox23.Selection.Offset(0,7) ???????
I am sure i can add something here but it has avoided me getting it to work.
Can anyone see how to do this ?
Corey....