Error message with AutoFilter

P

Peter Cloutier

When trying to use AutoFilter on a field, I occasionally
get a window that pops up with the warning "Fixed objects
will move" and an OK button. I have to ppress Enter or
click OK quite a few times before the filter action takes
place.
There are no objects such as drawing objects etc in the
sheet within the database.
Anybody know why and how to fix?
Thanks
 
D

Dave Peterson

I'd double check.

Hit Edit|goto|special
check Objects

Anything found?

I'm not sure if you can get that warning with invisble shapes, but just in case,
you could run something like this:

Option Explicit
Sub testme()

Dim myShape As Shape
Dim response As Long

For Each myShape In ActiveSheet.Shapes
With myShape
response = MsgBox(prompt:="delete shape at: " _
& .TopLeftCell.Address & vbLf _
& "Visible: " & CBool(.Visible), _
Buttons:=vbYesNoCancel)

If response = vbCancel Then
Exit Sub
Else
If response = vbYes Then
.Delete
End If
End If
End With
Next myShape

End Sub

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm
 
Top