I wrote a function to convert dates from yyyymmdd format to a numeric date (20061128 => 39049) but in addition to creating the date number I want the cell formatting changed to mm/dd/yy. Is there any way to do this automatically from within the function?
Function DateConv(DATE8N) As Date
Dim TextDate As String
TextDate = Mid(DATE8N, 5, 2) & “/” & Right(DATE8N, 2) & “/” & Left(DATE8N, 4)
DateConv = CDate(TextDate)
End Function