» 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:
- Excel 2002 Power Programming with VBA
- Finance and Accounting for Nonfinancial Managers
- H&R Block's Just Plain Smart(tm) Tax Planning Advisor: A year-round approach to lowering your taxes this year, next year and beyond
- Special Edition Using Microsoft Word 2002
- Microsoft Excel 2002 Simply Visual
- The Total Money Makeover. : A Proven Plan for Financial Fitness
No comments have been submitted.

