用VB读取csv里面的数据,当遇到日期格式,想直接读取,但偏偏VB给计算出结果了,怎么解决,我只想要日期

我用的是这种方法读取:litem.SubItems(2) = xlsheet.Cells(i, 8)
本来xlsheet.Cells(i, 8)的内容是:“12/06/2012 00:00:10.651”,结果被读出来是:“41249.0001232755”,我想要日期格式,怎么直接读取,求高手指点,谢谢。

litem.SubItems(2) = xlsheet.Cells(i, 8).Text '取得在单元格中显示的内容,xlsheet.Cells(i, 8)是取得value,不一样的。
温馨提示:答案为网友推荐,仅供参考
第1个回答  2012-12-23
用Format函数!
第2个回答  推荐于2020-12-07
litem.SubItems(2) = CStr(CDate(xlsheet.Cells(i, 8)))本回答被提问者采纳
相似回答