A VBA version of my suggestion in msg#4 could be:
Sub blah()
With ActiveSheet.Range("A1").ListObject
Set newColm = .ListColumns.Add
With newColm.DataBodyRange
.Cells(1) = 1
.DataSeries
End With
.Range.Sort key1:=newColm.Range, order1:=xlDescending, Header:=xlYes
.Range.RemoveDuplicates Columns:=1, Header:=xlYes
.Range.Sort key1:=newColm.Range, order1:=xlAscending, Header:=xlYes
newColm.Delete
.ListColumns("Day").Delete
End With
End Sub
and this works fine on a PC.
Remove Duplicates in vba seems to be a known problem on the Mac versions of Excel
It's a shame it doesn't work on a Mac because it is fast and efficient.
So we have to grow our own 'remove duplicates' procedure, and while we're at it, remove the duplicates from the top so we don't have to bother sorting:
Sub blah2()
Dim rngToDelete As Range
With ActiveSheet.Range("A1").ListObject '<<<< adjust this so you're looking at the right table.
x = .ListColumns(1).DataBodyRange.Value
For i = 1 To UBound(x)
y = Application.Match(x(i, 1), x, 0)
If y < i Then
x(y, 1) = "¬!"
If rngToDelete Is Nothing Then Set rngToDelete = .ListRows(y).Range Else Set rngToDelete = Union(rngToDelete, .ListRows(y).Range)
End If
Next i
If Not rngToDelete Is Nothing Then rngToDelete.Delete
.ListColumns("Day").Delete
End With
End Sub
However, at this stage, I'd have thought that my snippet in msg#3 is easier and faster.