error '438'

A

Alex

I have the error '438' - Object doesn't support this property or method.
Private Sub Worksheet_Activate() ' It's Sheet1
....
With Worksheets("Sheet1")
If Not .AutoFilterMode Then
.Range("A3").AutoFilter
End If
.EnableAutoFilter = True

.Protect Password:="password", _
Contents:=True, UserInterfaceOnly:=True
End With
Selection.AutoFilter Field:=1 ' Here I have an error
....

Can anybody advise what's wrong with this code?
Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top