用FORMAT函数,如:format(now,"yyyy-mm-dd hh:mm:ss")

解决方案 »

  1.   

    或者直接在excel里面调节一下该列的显示格式。
      

  2.   

    老兄,我必须拜托一件事儿,能不能告诉我如何把datagrid中的数据导入到excel中去啊,我现在很着急,所以很冒昧的拜托你了,可以高分相赠。
      

  3.   

    Dim i_row as integer
      dim i_col As Integer
      '创建EXCEL应用对象,以及相关的EXCEL对象并引用
      Set xlapp = CreateObject("excel.application")
      xlapp.Visible = True
      Set xlbook = xlapp.workbooks.Add
      Set xlsheet = xlbook.worksheets(1)
      i_row = 0
      Do While i_row < mshflexgrid.Rows
         For i_col = 0 To mshflexgrid.Cols - 1
             xlsheet.cells(i_row, i_col + 1) = mshflexgrid.TextMatrix (i_row, i_col)
         Next i_col
         i_row = i_row + 1
      Loop
      

  4.   

    我用的是datagrid,不用msflexgrid该怎么办啊
      

  5.   

    那你干吗不直接把rs倒入到excel中间