I'm updating an excel table from an ADODB recordset using the CopyFromRecordset
method.
After the update, the numbers show up as dates wherever there are number columns.
The workaround I used until now is to format the columns back to numbers through VBA, but it's not a good solution as takes more time for the report to complete. Also I have to write code to accommodate a lot of tables.
Is there a quick fix? Any help is greatly appreciated.
'Delete old data and copy the recordset to the table
Me.ListObjects(tblName).DataBodyRange.ClearContents
Me.Range(tblName).CopyFromRecordset rst
tblName
- refers to an existing table that held data of the same format/datatype as rst data