Below is an example of a macro that I use to convert dates in a spreadsheet from ddmmmmyyyy format to mm/dd/yyyy. In this case, I know which columns have dates in them (starting in row 2 on down, as row 1 as the column header). However, I routinely receive other spreadsheets with dates in columns that I do not know of in advance. Is there a macro that can "scan" for any date values in row 2, and then format the entire column where these dates are found to mm/dd/yyyy? Thanks.
![]()
Sub SelectColumns() Range("A:B,O:Q,BJ:BK").Select Selection.NumberFormat = "mm/dd/yyyy" End Sub
Bookmarks