- 帖子
- 58
- 主題
- 9
- 精華
- 0
- 積分
- 117
- 點名
- 0
- 作業系統
- XP
- 軟體版本
- 2003
- 閱讀權限
- 20
- 註冊時間
- 2017-12-2
- 最後登錄
- 2021-12-16
|
本帖最後由 wei9133 於 2020-10-9 01:16 編輯
回復 17# wei9133
我把我具體的操作錄成影片了,看一下或許能懂?
https://sendvid.com/suu270r2
其中整欄直接篩選成V或W的部分因為我已經錄成巨集所以沒有去拉下拉式選單- Sub 篩選為V() '^U
- Dim i As Integer
- i = ActiveCell.Column '獲取欄位值
- Cells(1, i).Select
- Selection.AutoFilter Field:=i, Criteria1:="V"
- '將該格篩選為"V"
- End Sub
- Sub 篩選為W() '^I
- Dim i As Integer
- i = ActiveCell.Column '獲取欄位值
- Cells(1, i).Select
- Selection.AutoFilter Field:=i, Criteria1:="W"
- '將該格篩選為"W"
- End Sub
- Sub 篩選為空格() '^B
- Dim i As Integer
- i = ActiveCell.Column '獲取欄位值
- Cells(1, i).Select
- Selection.AutoFilter Field:=i, Criteria1:="="
- '將該格篩選為"空格"
- End Sub
- Sub 篩選為非空格() 'O
- Dim i As Integer
- i = ActiveCell.Column '獲取欄位值
- Cells(1, i).Select
- Selection.AutoFilter Field:=i, Criteria1:="<>"
- '將該格篩選為"非空格"
- End Sub
- Sub 篩選為全選() '^+Q
- Dim i As Integer
- i = ActiveCell.Column '獲取欄位值
- Cells(1, i).Select
- Selection.AutoFilter Field:=i ' Criteria1:="<>" ,看起來沒有給後面這串指定值就是全部了
- '將該格篩選為"全部"
- End Sub
複製代碼 一開始我需要的功能需求其實是這個
在我選完某一邊之後,把另一邊全部由篩選下拉式選單選回"全選"
https://sendvid.com/3ifimegq
所以才會出現這種東西- sub 篩選後端 ()
- Sub 篩選後端()
- Dim var_min, var_max, i, j, s As Integer
- var_min = 51 '後半段起
- var_max = 99 '後半段迄
- For j = var_min To var_max
- j = j + 1
- Cells(1, j).Select
- Selection.AutoFilter Field:=j
- Next j
- End Sub
複製代碼 但是這組代碼好像沒用,所以才會來問 |
|