problem with autofilter and question about menu bar buttons

G

Guest

Hi there, I'm taying to say to one of my macros that when a autofilter is
"on"(or enabled) turn it "of" (diabled it), but if it's "of" DOESN'T DO
ANITHING. So I thought about:
If Selection.AutoFilter = True Then
Selection.AutoFilter
End If

but it seems that when the program execute the "if selection.autofilter" the
autofilter is enabled no matter wath happens

How could I make what I want????

2) I made a customized tool bar, I have a button that protect a woorksheet
and another button that unprotect the worksheet, so, the user need to press a
button to use the sheet and press another button when he finished is work,
How could I make that whenthe user press the button the sheet become
unprotected and when he presses again (the same button) the sheet becomes
protected??? something like the design button (and also I want to know if
it's posible that when the button is on (sheet unprotected) the button
appears with other image and when is of (sheet protected) appears with his
original image

TIA
 
T

Tom Ogilvy

No need to check

Activesheet.AutofilterMode = False

end result will be no autofilter on the sheet.
 

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