» Sort by birthday using VBA in Microsoft Excel
CATEGORY - Date & Time in VBA
VERSION - All Microsoft Excel Versions
How can I sort a sheet with names by birthdays without considering the year in the birthday?
Answer:
Place the code below into the standard module.
Sub Sort()
Dim intRow As Integer
Application.DisplayAlerts = False
intRow = Cells(Rows.Count, 1).End(xlUp).Row
Range("C1").FormulaR1C1 = "=TEXT(RC[-1],""MM.TT"")"
Range("C1:C" & intRow).FillDown
Range("A1").CurrentRegion.Sort _
key1:=Range("C1"), order1:=xlAscending, _
key2:=Range("A1"), order2:=xlAscending, _
header:=xlNo
Columns("C").Delete
Application.DisplayAlerts = True
End Sub
Book Store:
Recommended Books:
No comments have been submitted.

