I have an excel spreadsheet that is being imported into access. I have many date fields included in this spreadsheet. For some reason, there are a few fields that do not show up properly in access. For example, I have a date in the excel file (08/25/2008) that shows up in access as 39685. Why is this happening?
When I create some vba code to change the date format in the excel, it works out just fine. My next problem is that I have had to hard code these specific fields in, and while the code works great for the first field, when the second field appears, the entire sheet is transferred into date format.
Code:
If ActiveCell.Value = "Project First Date" Then
ActiveCell.Value = Replace(ActiveCell.Value, " ", "_")
ActiveCell.EntireColumn.Select
Selection.NumberFormat = "m/d/yyyy"
ActiveCell.Offset(0, 1).Select
End If
If ActiveCell.Value = "Project Finish Date" Then
ActiveCell.Value = Replace(ActiveCell.Value, " ", "_")
ActiveCell.EntireColumn.Select
Selection.NumberFormat = "m/d/yyyy"
ActiveCell.Offset(0, 1).Select
End If
If ActiveCell.Value = "Project Forecast Finish Date" Then
ActiveCell.Value = Replace(ActiveCell.Value, " ", "_")
ActiveCell.EntireColumn.Select
Selection.NumberFormat = "m/d/yyyy"
ActiveCell.Offset(0, 1).Select
End If
Any thoughts on this would be appreciated!