This is the code for the date converter macro:
Public Sub DateConverter()
Dim rngCells As Range
Dim rngCell As Range
Dim strMsg As String
Dim intDay As Integer
Dim intMonth As Integer
Dim intYear As Integer
Dim DateValue As Date
On Error Resume Next
strMsg = “Select the cells to convert:” & _
vbCr & vbCr & “Reverses Month and Day date evaluation,” _
& vbCr & “i.e. MM-DD becomes DD-MM if possible.”
‘Receive the input.
Set rngCells = Application.InputBox(strMsg, “Date Converter”, , , , , , 8)
‘Test for no input received.
If Not IsObject(rngCells) Or rngCells Is Nothing Then
GoTo Exit_DateConverter
End If
‘Date Conversion Loop.
For Each rngCell In rngCells
If IsDate(rngCell) Then
intDay = Day(rngCell)
intMonth = Month(rngCell)
intYear = Year(rngCell)
DateValue = intMonth & “/” & intDay & “/” & intYear
rngCell.Value = DateValue
End If
Next
Exit_DateConverter:
End Sub