May be you need to delete previous data that are in f1,g1, etc.:
Sub Macro1()
Application.ScreenUpdating = False
With ThisWorkbook.ActiveSheet
.Range("a1").Offset(, 5).Resize(, Columns.Count - 5).ClearContents
.Columns("A:A").AdvancedFilter Action:=xlFilterCopy, _
CopyToRange:=.Range("F1"), Unique:=True
lastrow = .Cells(Rows.Count, "f").End(xlUp).Row
.Range("f2:f" & lastrow).Copy
.Range("g1").PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=True
.Columns("f").Delete
End With
Application.ScreenUpdating = True
End Sub
Regards,
Antonio
Bookmarks