Try:
Sub foo()
Dim wsSrc As Worksheet
Dim wsTgt As Worksheet
Dim arrCopy() As Variant
Dim i As Integer
Dim iMonth As String
Dim sMonth As String
On Error GoTo Terminate
With Application
.ScreenUpdating = False
.DisplayAlerts = False
End With
Set wsSrc = Worksheets("Account")
arrCopy = Array("A", "B", "D", "F", "H", "I", "K")
iMonth = Month(Date)
sMonth = Format(Date, "MMM")
If SheetExists(sMonth) Then Worksheets(sMonth).Delete
Set wsTgt = Worksheets.Add(After:=Worksheets(Worksheets.Count))
wsTgt.Name = sMonth
With wsSrc
.AutoFilterMode = False
.UsedRange.AutoFilter field:=2, Criteria1:=RGB(255, 255, 0), Operator:=xlFilterCellColor
For i = LBound(arrCopy) To UBound(arrCopy)
.UsedRange.Columns(arrCopy(i)).SpecialCells(xlCellTypeVisible).Copy wsTgt.Cells(1, i + 1)
Next i
.UsedRange.Columns(11 + iMonth).SpecialCells(xlCellTypeVisible).Copy wsTgt.Cells(1, Columns.Count).End(xlToLeft).Offset(0, 1)
.AutoFilterMode = False
End With
Terminate:
If Err Then
Debug.Print "ERROR", Err.Number, Err.Description
Err.Clear
End If
With Application
.DisplayAlerts = True
.ScreenUpdating = True
End With
End Sub
Function SheetExists(ByVal sSheetName As String) As Boolean
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
If UCase(ws.Name) = UCase(sSheetName) Then
SheetExists = True
Exit Function
End If
Next ws
End Function
Bookmarks