0
我想寫一個宏,它應該像Excel過濾器一樣工作。在使用這個過濾器獲得所有數據後,我想粘貼到新的工作表中。在Sheet1和副本Excel過濾器宏
我想寫一個宏,它應該像Excel過濾器一樣工作。在使用這個過濾器獲得所有數據後,我想粘貼到新的工作表中。在Sheet1和副本Excel過濾器宏
此子濾波器零值到Sheet2範圍A1
Sub FilterAndCopy()
'Developer by Bruno Leite
'http://officevb.com
Dim Sht As Worksheet
Dim FilterRange As Range
'Set your Sheet
Set Sht = ThisWorkbook.Sheets("Sheet1")
'Verify if is Filter
If Sht.FilterMode Then
Sht.ShowAllData
End If
'Filter Column A with 0 at parameter
Sht.Range("A:A").AutoFilter Field:=1, Criteria1:="0"
'Define Range Of Visible cells without row title
Set FilterRange = Sht.Range("A1").CurrentRegion.Offset(1, 0).SpecialCells(xlCellTypeVisible)
FilterRange.Copy Sheets("Sheet2").Range("A1")
Sht.ShowAllData
End Sub
[]的
你應該嘗試拍攝這樣的事情宏。然後調整適合的代碼。 – Reafidy