Sub format()
Dim LR As Long
LR = ActiveSheet.Cells(Rows.Count, 2).End(xlUp).Row
Cells.Select
Cells.AutoFilter Field:=3, Criteria1:="<>"
Cells.AutoFilter Field:=1, Criteria1:="="
Range("A2").FormulaR1C1 = "=+R[-1]C"
Range("G2").FormulaR1C1 = "=RC[-6]&"" ""&RC[-4]"
Range("A2").Copy
Range("A2:A" & LR).SpecialCells(xlCellTypeVisible).Select
ActiveSheet.Paste
Application.CutCopyMode = False
Cells.AutoFilter Field:=3
Cells.AutoFilter Field:=1, Criteria1:="<>"
Range("G2").Copy
Range("G2:G" & LR).SpecialCells(xlCellTypeVisible).Select
ActiveSheet.Paste
Application.CutCopyMode = False
Range("A1").AutoFilter
Range("A1").Select
Columns("A").Copy
Columns("A").PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Columns("G").Copy
Columns("G").PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Columns("G:G").EntireColumn.AutoFit
Range("A1").Select
End Sub