VBeginner
03-18-2003, 09:16 PM
Hi again,
I have code to search in a column for a particular value, then insert a row where it is found. This leaves with the inserted row activated. I then want to put TextBox1.Text into Column E of this inserted Row, and ComboBox1.Value into Column F.
For some reason I can't. The corresponding code is as follows:
If iReturn = vbNo Then
Exit Sub
Else
Set Found = Sheets("Codes").Columns("F:F").Find(What:=ComboBox1.Value, After:=ActiveCell, LookIn:=xlValues, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False)
'Check whether something is found
If Not Found Is Nothing Then
Found.Rows.EntireRow.Insert Shift:=xlDown
Row.Column(5) = TextBox1.Text 'This is the Problem
Row.Column(6) = ComboBox1.Value
Else
End If
Thanks,
Nick
I have code to search in a column for a particular value, then insert a row where it is found. This leaves with the inserted row activated. I then want to put TextBox1.Text into Column E of this inserted Row, and ComboBox1.Value into Column F.
For some reason I can't. The corresponding code is as follows:
If iReturn = vbNo Then
Exit Sub
Else
Set Found = Sheets("Codes").Columns("F:F").Find(What:=ComboBox1.Value, After:=ActiveCell, LookIn:=xlValues, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False)
'Check whether something is found
If Not Found Is Nothing Then
Found.Rows.EntireRow.Insert Shift:=xlDown
Row.Column(5) = TextBox1.Text 'This is the Problem
Row.Column(6) = ComboBox1.Value
Else
End If
Thanks,
Nick