All,
Im trying to figure out why the following code is not working... Im trying to pull data from a sheet into a textbox based on the change of a combobox. See below;
If i run the following code the code runs, but only brings the latest date in relation to a "NA" line on the spreadsheet and then stops.
Any help would be greatly appreciated. Thanks!!
Im trying to figure out why the following code is not working... Im trying to pull data from a sheet into a textbox based on the change of a combobox. See below;
VBA Code:
Private Sub ComboBox10_Change()
Dim i As Long
Dim lastrow As Long
Dim ws As Worksheet
Me.TextBox13 = ""
Set ws = Sheets("paste log")
lastrow = ws.Range("f" & Rows.Count).End(xlUp).Row
For i = 2 To lastrow
If Me.ComboBox11.Value = ws.Cells(i, "b") & Me.ComboBox8.Value = ws.Cells(i, "c") Then
Me.TextBox13 = ws.Cells(i, "f").Text
End If
Next i
End Sub
If i run the following code the code runs, but only brings the latest date in relation to a "NA" line on the spreadsheet and then stops.
VBA Code:
Private Sub ComboBox10_Change()
Dim i As Long
Dim lastrow As Long
Dim ws As Worksheet
Me.TextBox13 = ""
Set ws = Sheets("paste log")
lastrow = ws.Range("f" & Rows.Count).End(xlUp).Row
For i = 2 To lastrow
If Me.ComboBox10.Value = ws.Cells(i, "e") Then
Me.TextBox13 = ws.Cells(i, "f").Text
End If
Next i
End Sub
Any help would be greatly appreciated. Thanks!!