ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   problem with autofilter and question about menu bar buttons (https://www.excelbanter.com/excel-programming/328843-problem-autofilter-question-about-menu-bar-buttons.html)

filo666

problem with autofilter and question about menu bar buttons
 
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

Tom Ogilvy

problem with autofilter and question about menu bar buttons
 
No need to check

Activesheet.AutofilterMode = False

end result will be no autofilter on the sheet.

--
Regards,
Tom Ogilvy


"filo666" wrote in message
...
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





All times are GMT +1. The time now is 09:50 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com