Hi All
I am getting the above error when using the code below. I think it is happening because the result of the cell that the textbox is looking at is #N/A. I cant seem to find a simple way of ignoring any errors that occur which they may or may not do depending on what value is input into textbox 1.
Any help would be much appreciated
Private Sub CommandButton2_Click()
Dim rngI As Range
With Worksheets("Re-evaluated posts").Range("H:H")
Set rngI = .Find(TextBox1.Value) 'find the value of textbox 1
TextBox5.Value = rngI.Offset(0, 1).Value
TextBox6.Value = rngI.Offset(0, 2).Value
TextBox9.Value = rngI.Offset(0, 5).Value
TextBox10.Value = rngI.Offset(0, 6).Value
TextBox11.Value = rngI.Offset(0, 7).Value
End With
End Sub
I am getting the above error when using the code below. I think it is happening because the result of the cell that the textbox is looking at is #N/A. I cant seem to find a simple way of ignoring any errors that occur which they may or may not do depending on what value is input into textbox 1.
Any help would be much appreciated
Private Sub CommandButton2_Click()
Dim rngI As Range
With Worksheets("Re-evaluated posts").Range("H:H")
Set rngI = .Find(TextBox1.Value) 'find the value of textbox 1
TextBox5.Value = rngI.Offset(0, 1).Value
TextBox6.Value = rngI.Offset(0, 2).Value
TextBox9.Value = rngI.Offset(0, 5).Value
TextBox10.Value = rngI.Offset(0, 6).Value
TextBox11.Value = rngI.Offset(0, 7).Value
End With
End Sub