Run Time error 2147352571

macangc

Board Regular
Joined
Mar 28, 2006
Messages
140
Office Version
  1. 365
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
 

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.

Forum statistics

Threads
1,214,932
Messages
6,122,331
Members
449,077
Latest member
jmsotelo

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top