Sub SamsMacro1()
Application.ScreenUpdating = False
Application.DisplayAlerts = False
'Stuff to initialise at start
'--------------------------------------------------------------------
Dim DataSheet As Worksheet
Dim DataSheetName As String
Set DataSheet = ActiveSheet
' If the data is on a specific worksheet (e.g. Sheet1 or different name)
' change line above to Set DataSheet = Sheets("<name of sheet>")
' including the " " but NOT the < or >
DataSheetName = ActiveSheet.Name
ActiveSheet.Select
' Code below deletes data for plans you don't want
'--------------------------------------------------------------------
Range("B:B").Replace what:="50", Replacement:="z50", lookat:=xlWhole
Range("B:B").Replace what:="60", Replacement:="z60", lookat:=xlWhole
Range("B:B").Replace what:="70", Replacement:="z70", lookat:=xlWhole
Range("B:B").Replace what:="80", Replacement:="z80", lookat:=xlWhole
'ActiveSheet.Sort.SortFields.Clear
' Do not delete the line below, it places a dummy z value for the find
' feature to work, otherwise if no z's found, it throws up an error
Range("B" & Rows.Count).End(xlUp).Offset(1, 0) = "z"
Range("A:B").Sort key1:=Range("B:B"), Order1:=xlAscending, Header:=xlYes
Range("B:B").Find(what:="z", after:=Range("B1"), lookat:=xlPart, _
MatchCase:=xlYes).EntireRow.Insert
Range("A1").End(xlDown).Offset(2, 0).CurrentRegion.ClearContents
'--------------------------------------------------------------------
' Code below removes duplicates
'--------------------------------------------------------------------
Sheets.Add.Name = "Temp"
DataSheet.Range("A:BO").AdvancedFilter xlFilterCopy, criteriarange:=Range("A1"), _
CopytoRange:=Sheets("Temp").Range("A1"), unique:=xlYes
DataSheet.Delete
Sheets("Temp").Name = DataSheetName
'--------------------------------------------------------------------
End Sub