![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Board Regular
Join Date: Mar 2002
Location: Arkansas
Posts: 358
|
I was wondering if there was anyway to protect a sheet, and still be able to use the autofilter function. Thanks Dan
|
|
|
|
|
|
#2 |
|
Board Regular
Join Date: Feb 2002
Posts: 202
|
not sure if this is suitable, but you could protect your sheet and use another sheet with =Sheet1!$A$1 refs for the autofilter. you could also use an array (eg. =Sheet1!$A$1:$A$20 & ctrl+shift+enter) for the second sheet, which you can still autofilter but the user can't for instance just change one cell in the array.
|
|
|
|
|
|
#3 |
|
Board Regular
Join Date: Mar 2002
Location: Arkansas
Posts: 358
|
I have a vba that will let you use the advance filter option, but cant seam to be able to make the autofilter work.
Private Sub Workbook_Open() Application.CommandBars("Worksheet Menu Bar").Controls _ ("Data").Controls("filter").Enabled = True End Sub |
|
|
|
|
|
#4 |
|
Board Regular
Join Date: Mar 2002
Location: Sydney/Brisbane , Australia
Posts: 539
|
will the user be looking for one set thing at a time.
eg. "SMITH" or will they be looking for "SM......" or blanks? |
|
|
|
|
|
#5 |
|
Board Regular
Join Date: Mar 2002
Location: Arkansas
Posts: 358
|
I am filtering a query which is a large dbase, there are 8 different collums and many ways to search for data. I noteced the Advanced filter works with the code above, I didnt know if there was a way to get to the sub-menu Item. thx
|
|
|
|
|
|
#6 | |
|
Board Regular
Join Date: Feb 2002
Posts: 202
|
Quote:
|
|
|
|
|
|
|
#7 |
|
Board Regular
Join Date: Mar 2002
Location: Sydney/Brisbane , Australia
Posts: 539
|
SOLUTION
With Worksheets("myworksheet") .EnableSelection = xlUnlockedCells .Protect DrawingObjects:=True, contents:=True, userInterfaceOnly:=True .EnableAutoFilter = True .Protect contents:=True, userInterfaceOnly:=True End With It' taken me months to get this |
|
|
|
|
|
#8 |
|
Board Regular
Join Date: Mar 2002
Location: Sydney/Brisbane , Australia
Posts: 539
|
put the above code in your sheets macro
|
|
|
|
|
|
#9 |
|
Board Regular
Join Date: Mar 2002
Location: Arkansas
Posts: 358
|
thanks Qroozn, I put it under my sheet1 general, but still only have the advanced filter option. Is it in the correct place ?
|
|
|
|
|
|
#10 |
|
Board Regular
Join Date: Mar 2002
Location: Sydney/Brisbane , Australia
Posts: 539
|
is your autofilter saved on your worksheet?
the macro should stop you being able to select anything except the autofilters already on the worksheet. |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|