I have a column of data that is in date format and when I export it into Excel I loose the date format. I have tried using the following:
varFieldValue = rstDetail.Fields(i).Name
If varFieldValue = "PPE Date" Then
.Cells(1, i + 2).Value = Format(varFieldValue, "Short Date"![Wink ;) ;)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
Else
.Cells(1, i + 2).Value = varFieldValue
End If
and it doesn't work. I know I am not the best coder, but I I thought if I knew the Value of the field I want to format I could just format it via the format method.
varFieldValue = rstDetail.Fields(i).Name
If varFieldValue = "PPE Date" Then
.Cells(1, i + 2).Value = Format(varFieldValue, "Short Date"
Else
.Cells(1, i + 2).Value = varFieldValue
End If
and it doesn't work. I know I am not the best coder, but I I thought if I knew the Value of the field I want to format I could just format it via the format method.