farmergeoff2003
New Member
- Joined
- Jul 25, 2013
- Messages
- 8
I cannot copy date formatted cells (that actually contain dates, some contain text) from one sheet to another through an ADO connection. I am not interested in using excel functions, only VBA. Thank you!!!
[VBA Code]
ws3.Cells(row, 2).Value = rs2.Fields.Item("Name")
ws3.Cells(row, 3).Value = rs2.Fields.Item("Model/Type")
ws3.Cells(row, 5).Value = rs2.Fields.Item("Serial")
'format cell in date format
ws3.Cells(row, 10).Value = Format(rs2.Fields.Item("Date Returned"), "mmm-yy") '<---------
The cells in ws3 are empty besides the copied cells that contain text such as "Purchased."
[The original cells (rs2)]
N/A <----Works
N/A <----Works
Purchased <----Works
Apr-12 <----- does not get copied</SPAN>
Apr-12 <----- does not get copied</SPAN>
</SPAN>Apr-12 <----- does not get copied</SPAN>
</SPAN>
[VBA Code]
ws3.Cells(row, 2).Value = rs2.Fields.Item("Name")
ws3.Cells(row, 3).Value = rs2.Fields.Item("Model/Type")
ws3.Cells(row, 5).Value = rs2.Fields.Item("Serial")
'format cell in date format
ws3.Cells(row, 10).Value = Format(rs2.Fields.Item("Date Returned"), "mmm-yy") '<---------
The cells in ws3 are empty besides the copied cells that contain text such as "Purchased."
[The original cells (rs2)]
N/A <----Works
N/A <----Works
Purchased <----Works
Apr-12 <----- does not get copied</SPAN>
Apr-12 <----- does not get copied</SPAN>
</SPAN>Apr-12 <----- does not get copied</SPAN>
</SPAN>