Ads
Ads
Private Sub Worksheet_Change(ByVal Target As Range)
Dim KeyCells As Range
' The Range that Cell value change will trigger update
Set KeyCells = Range("A:C")
If Not Application.Intersect(KeyCells, Range(Target.Address)) Is Nothing Then
Range("A:D").AutoFilter Field:=4, Criteria1:=False
End If
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
Dim KeyCells As Range
Set KeyCells = Range("A:Z") '自己改個Range
If Not Application.Intersect(KeyCells, Range(Target.Address)) _
Is Nothing Then
ActiveSheet.AutoFilter.ApplyFilter
End If
End Sub
我習慣左用 Ctrl+Alt+L re-apply filter唔識都做到開一行column 做判斷要hide or not .我e 家就係開一個column 用if 去判斷出"hide", 上面用filter 去hide. 但個個row有時唔洗show 想automatic d, 唔洗次次做完都filter 一次。
跟住你要用filter 或者 vba 去hide 都得。
好處係condition改的話只係改formula, vba 分離 左(好重要)
唔好處係要每行都要有。
我上網搵到個VBA 係話可以自己refresh filter 但唔知咩問題唔work.
利申:唔識寫vba :^(
你record 你filter TRUE果下動作
到時click左個制咪filter到
其實都幾方便, 習慣左就好順手好快
如果你要用VBA自動Re-apply既話就Copy下面果段
一定要放入張Worksheet度(Right Click worksheet tab, 檢視原始碼)
但用VBA之後你無得Ctrl + Z還原
Private Sub Worksheet_Change(ByVal Target As Range) Dim KeyCells As Range Set KeyCells = Range("A:Z") '自己改個Range If Not Application.Intersect(KeyCells, Range(Target.Address)) _ Is Nothing Then ActiveSheet.AutoFilter.ApplyFilter End If End Sub
Ads
我用filter 係做到但想佢自動hide, 唔洗做完一次要filter 一次。
有冇巴打幫到手?