Hi all,

I have a command button which should run this code:

 Private Sub CommandButton1_Click()

Dim message1 As Integer
On Error GoTo UserInterrupt
Application.EnableCancelKey = xlErrorHandler

message1 = MsgBox("clicking OK will clear any non-updated data", vbOKCancel)
If message1 = 1 Then

Range("A6:L10000").Clear
Range("Sheet3!A3:Sheet3!L10000").Clear

Find_Range("4", Range("Sheet2!L3:Sheet2!L100000"), xlformulas, xlwhole).EntireRow.Copy Range("A7")

Range("B7").Select

End If

Exit Sub

UserInterrupt:

Dim messagebox As Integer
      If Err = 91 Then
      
      messagebox = MsgBox("Part(s) Not Found", vbOKOnly)
        
      End If


End Sub
The code is fine, if I put it into a module and run it, it does exactly what I want.

However, I can't run it from a module as when I click 'go to code' for the button it goes to the sheet and starts a Sub for it.

if I put the code into this Sheet1 Private Sub and then click the button it only runs the message1 and clear parts and not any of the find function (which I know works)

any ideas?

Cheers,

Bryn