Anyone have the simple answer or complex to this?
Can't get this bit of code to work. It runs throught the If arguments and stops at the "Then" argument.
I am attempting to use the IF to populate TB2, a testbox field, and TB10, a text box field, tied to a spin button. The base is pulled from a column and incremented up or down . At the push of this button the edited TB10 and TB2 should have their contents copied over the existing content.
It works with TB2, I have added the TB10 text and it is throwing an error. Here is my latest code on it.
Help??
Debbie
Can't get this bit of code to work. It runs throught the If arguments and stops at the "Then" argument.
I am attempting to use the IF to populate TB2, a testbox field, and TB10, a text box field, tied to a spin button. The base is pulled from a column and incremented up or down . At the push of this button the edited TB10 and TB2 should have their contents copied over the existing content.
It works with TB2, I have added the TB10 text and it is throwing an error. Here is my latest code on it.
Help??
Debbie
Code:
Private Sub Done_Click()
Dim Cell As Range, strTemp As String
With Sheets("Inventory")
For Each Cell In .Range("B2", .Range("B" & Rows.Count).End(xlUp))
If Cell = CB1.Text _
And Cell.Offset(0, 1) = CB2.Text _
And Cell.Offset(0, 2) = CB3.Text _
And Cell.Offset(0, 4) = CB4.Text Then
Cell.Offset(0, 5).Value = TB2.Text And Cell.Offset(0, 6).Text = TB10.Text
Exit Sub
End If
Next Cell
End With
End Sub