Sub AddSheet()
Application.ScreenUpdating = False
Dim bottomG As Long
bottomG = Range("G" & Rows.Count).End(xlUp).Row
Dim c As Range
Dim ws As Worksheet
If Sheets("All Accounts").FilterMode Then Sheets("All Accounts").ShowAllData
For Each c In Range("G2:G" & bottomG)
If c <> "" Then
Set ws = Nothing
On Error Resume Next
Set ws = Worksheets(c.Value)
On Error GoTo 0
If ws Is Nothing Then
Worksheets.Add(After:=Sheets(Sheets.Count)).Name = c.Value
Sheets("All Accounts").Range("A1:N" & bottomG).AutoFilter Field:=7, Criteria1:=c
Sheets("All Accounts").Range("A1:N" & bottomG).SpecialCells(xlCellTypeVisible).EntireRow.Copy ActiveSheet.Cells(1, 1)
ActiveSheet.Columns.AutoFit
Else
Sheets(c.Value).UsedRange.ClearContents
Sheets("All Accounts").Range("A1:N" & bottomG).AutoFilter Field:=7, Criteria1:=c
Sheets("All Accounts").Range("A1:N" & bottomG).SpecialCells(xlCellTypeVisible).EntireRow.Copy Sheets(c.Value).Cells(1, 1)
Sheets(c.Value).Columns.AutoFit
End If
If Sheets("All Accounts").FilterMode Then Sheets("All Accounts").ShowAllData
End If
Next c
Application.ScreenUpdating = True
End Sub