返回列表 上一主題 發帖

Excel 點選任一儲存格,以按鈕篩選結果

Excel 點選任一儲存格,以按鈕篩選結果

本帖最後由 oobird 於 2011-8-15 13:11 編輯

[attach]7460[/attach]

sheet2.png (63.67 KB)

sheet2.png

  1. Private Sub CommandButton1_Click()
  2.     If Cells.SpecialCells(12).Rows.Count = 65536 Then
  3.         Set Rng = Range([a2], [f65536].End(3)).ColumnDifferences(Selection)
  4.         Rng.EntireRow.Hidden = True
  5.     Else
  6.         Cells.EntireRow.Hidden = False
  7.     End If
  8. End Sub
複製代碼
a.gif

TOP

是一個很好的創意

可以做成增益集工具的一部份 就會更好了
Hung-Chi Lin/林宏吉
HUNGCHILIN/林宏吉的OFFICE專欄

TOP

回復 2# oobird

請問 SpecialCells(12) 的 12 含義為何
其他相關的數字有無資料可參考
  1. XlCellType 可以是這些 XlCellType 常數之一。
  2. xlCellTypeAllFormatConditions。  任何格式的儲存格
  3. xlCellTypeAllValidation。具有驗證準則的儲存格
  4. xlCellTypeBlanks。空儲存格
  5. xlCellTypeComments。包含註解的儲存格
  6. xlCellTypeConstants。包含常數的儲存格
  7. xlCellTypeFormulas。包含公式的儲存格
  8. xlCellTypeLastCell。已用範圍的最後一個儲存格
  9. xlCellTypeSameFormatConditions。  有相同格式的儲存格
  10. xlCellTypeSameValidation。  有相同驗證準則的儲存格
  11. xlCellTypeVisible。所有可見儲存格
複製代碼
100 字節以內
不支持自定義 Discuz! 代碼

TOP

        靜思自在 : 難行能行,難捨能捨,難為能為,才能昇華自我的人格。
返回列表 上一主題