返回列表 上一主題 發帖

[發問] 禁止使用進階篩選問題

回復 1# asimov


    http://www.excelforum.com/excel-worksheet-functions/622120-disabling-the-advanced-filter-function.html

After i protect the sheet and disable the autofilter function
The Advanced Filter menu can be disabled just like any other menu item using VBA.
The following statement will disable that entry:
在被保護的工作表下禁用進階篩選
他是用VBA寫的...麻煩asimov先進..您到這網站去看囉...
http://translate.google.com.tw/translate?hl=zh-TW&sl=en&tl=zh-TW&u=http%3A%2F%2Fwww.excelforum.com%2Fexcel-worksheet-functions%2F622120-disabling-the-advanced-filter-function.html&anno=2

代碼: Code:
Application.CommandBars
Application.CommandBars("Data").
Controls("Filter").Controls("Advanced Filter...")
Enabled
學如逆水行舟 不進則退

TOP

回復 6# asimov

asimov先進
   
http://translate.google.com.tw/translate?hl=zh-TW&sl=en&tl=zh-TW&u=http%3A%2F%2Fwww.excelforum.com%2Fexcel-worksheet-functions%2F622120-disabling-the-advanced-filter-function.html&anno=2

這篇文章的最後1句就是您要的結果的...您可以試試看.....

The following code would re-activate the Advanced Filter menu option, and could be placed in the ThisWorkbook module.
In the VB Editor (press ALT+F11 to get there), double-click on the 'ThisWorkbook' entry in the left-hand column, then paste this code:
在VB編輯器(按Alt + F11到那裡),雙擊的'的ThisWorkbook'項目在左側列中,然後貼上此代碼:



取消:Application.CommandBars Application.CommandBars("Data").Controls("Filter").Controls("Advanced Filter...").Enabled = False

恢復(啟用):Private Sub Workbook_BeforeClose(Cancel As Boolean) Application.CommandBars("Data").Controls("Filter").Controls("Advanced Filter...").Enabled = True End Sub

回復 #7 GBKEE

版主可以另外請問您程式中的(, 901).是什麼意思嗎?謝謝您…
學如逆水行舟 不進則退

TOP

回復 10# asimov

asimov先進
這問題問過GBKEE版主才知道那篇英文
是以"英文"去做保護工作表後--禁止篩選
    Application.CommandBars("Data").Controls("Filter").Controls("Advanced Filter...")
=Application.CommandBars.FindControl(, 901)=進階篩選指令
但這是英文版(粗體字的部份), 不適用於中文版
進階篩選指令的ID 為 901,  每一個指令都有一個不同的 ID號碼
所以您提問是"進階篩選"ID就是901
學如逆水行舟 不進則退

TOP

        靜思自在 : 有多少力量就做多少事,不要心存等待,等待才會落空。
返回列表 上一主題