ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Find Selected value to .Offset from (https://www.excelbanter.com/excel-programming/381025-find-selected-value-offset.html)

Corey

Find Selected value to .Offset from
 
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....




All times are GMT +1. The time now is 01:22 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com