yes, it works like a charm.
Can we clear content from next sheet & paste them directly to there ?
Option Explicit
Sub Macro2()
Application.ScreenUpdating = False
Sheet2.UsedRange.Clear
With Sheet1
.UsedRange.AutoFilter Field:=1, Criteria1:="<>BIF*", Operator:=xlAnd, Criteria2:="<>SR-*"
.AutoFilter.Range.Copy Sheet2.[A1]
.AutoFilterMode = False
End With
Sheet2.Columns.AutoFit
Application.ScreenUpdating = True
End Sub
.AutoFilter.Range.Resize(, 1).Copy Sheet2.[A1]
@Deepak .
If I have actual data starting from A14, how can I filter from that part?
Can we modify this part please?
Option Explicit
Sub Macro3()
Dim myRng As Range
Application.ScreenUpdating = False
Set myRng = ActiveSheet.Range("A14:B20")
Sheet2.UsedRange.Clear
With myRng
.AutoFilter Field:=1, Criteria1:="<>BIF*", Operator:=xlAnd, Criteria2:="<>SR-*"
.AutoFilter.Range.Copy Sheet2.[A1]
.AutoFilterMode = False
End With
Sheet2.Columns.AutoFit
Application.ScreenUpdating = True
End Sub
Please see the attached file. I have included the code as well
Sub Macro4()
Application.ScreenUpdating = False
With Range("A13").CurrentRegion
.AutoFilter Field:=1, Criteria1:="<>BIF*", Operator:=xlAnd, Criteria2:="<>SR-*"
.SpecialCells(xlCellTypeVisible).Copy Sheet2.[A19]
'.AutoFilter.Range.Resize(, 1).Copy Sheet2.[A1]
ActiveSheet.AutoFilterMode = False
End With
Sheet2.Columns.AutoFit
Application.ScreenUpdating = True
End Sub
@Deepak Please note, data to be pasted only Column A but this is pasting everything. Pls advise
Sub Macro5()
Application.ScreenUpdating = False
Sheet2.[A19].CurrentRegion.Cells.Clear
With Range("A13").CurrentRegion.Resize(, 1)
.AutoFilter Field:=1, Criteria1:="<>BIF*", Operator:=xlAnd, Criteria2:="<>SR-*"
.SpecialCells(xlCellTypeConstants).Copy Sheet2.[A19]
ActiveSheet.AutoFilterMode = False
End With
Sheet2.Columns.AutoFit
Application.ScreenUpdating = True
End Sub