Method 'Range' of object '_Worksheet' failed (msg)

-=NO=-

New Member
Joined
May 9, 2011
Messages
27
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
hey.

I have this code, and when i run it, I get a msg "Method 'Range' of object '_Worksheet' failed"

in that range

Code:
Set rSearch1 = Sheet1.Range("B7", Range("B65536").End(xlUp))
the full code, here

Code:
Private Sub ComboBox8_Change()
Dim strFind1 As String  'what to find
    Dim rSearch1, c As Range 'range to search
    Set rSearch1 = Sheet1.Range("B7", Range("B65536").End(xlUp))
    strFind1 = Me.ComboBox8.Value    'what to look for
    With rSearch1
        Set c = .Find(strFind1, LookIn:=xlValues)
                    If Not c Is Nothing Then
                        c.Select
                            With Me    'load entry to form
                            .ComboBox2.Value = c.Offset(0, 1).Value
                            .TextBox1.Value = c.Offset(0, 2).Value
                            .TextBox3.Value = c.Offset(0, 3).Value
                            .TextBox4.Value = c.Offset(0, 4).Value
                            .TextBox8.Value = c.Offset(0, 5).Value
                            .TextBox5.Value = c.Offset(0, 6).Value
                            .ComboBox3.Value = c.Offset(0, 7).Value
                            .TextBox9.Value = c.Offset(0, 8).Value
                            .ComboBox4.Value = c.Offset(0, 9).Value
                            .TextBox10.Value = c.Offset(0, 10).Value
                            .ComboBox5.Value = c.Offset(0, 11).Value
                            .ComboBox7.Value = c.Offset(0, 12).Value
                            .TextBox2.Value = c.Offset(0, 13).Value
                            .TextBox6.Value = c.Offset(0, 14).Value
                            .TextBox7.Value = c.Offset(0, 15).Value
                            .ComboBox6.Value = c.Offset(0, 16).Value
                            .cmbAmend.Enabled = True     'allow amendment or
                            .cmbDelete.Enabled = True    'allow record deletion
                            .cmbAdd.Enabled = False      'don't want to duplicate record
                            .cmbOk.Enabled = False
                           ' .ComboBox8.SetFocus
                    
    End With
    If tgl1.Caption = "New" Then
    ComboBox8.SetFocus
    Else
    ComboBox6.SetFocus
    End If
    
        Else: MsgBox strFind1 & " not listed"    'search failed
        ComboBox8.SetFocus
        End If
        
    End With

End Sub

I'm not sure what I'm missing. Seems like it should be a simple problem, but I can't seem to find it.

Thanks for all your help.​
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.

Forum statistics

Threads
1,224,503
Messages
6,179,136
Members
452,890
Latest member
Nikhil Ramesh

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