|
Windows是已经写好了能用的 把系统时间改成 YY.M.DD 代码如下
- Sub autodaoru()
- Application.DisplayAlerts = False
- Application.ScreenUpdating = False
- Dim cuDate As String
- Dim wb As Workbook
- cuDate = Date
- Arr1 = Array("de", "fr", "it", "es", "de库存", "de预留", "de库龄")
- Arr2 = Array("销售情况_DE", "销售情况_FR", "销售情况_IT", "销售情况_ES", "库存情况", "预留库存", "库龄")
- For i = 0 To 6
- ThisWorkbook.Sheets(Arr2(i)).Cells.Clear
- LJ = "C:\Users\Administrator\Desktop\Super Browser\Khanka-EU-Administrator\表格记录" & cuDate & "" & Arr1(i)
- Set wb = GetObject(LJ & ".csv")
- With wb.Sheets(Arr1(i)).Range("A1").CurrentRegion
- Sheets(Arr2(i)).Range("A1").Resize(.rows.Count, .Columns.Count) = .Value
- End With
- wb.Close False
- Next
- MsgBox ("导入完成")
- End Sub
复制代码 但是在 Mac上无法运行 Mac上的 Date 无法使用 用的是cuDate = Split(CDate(Now), " ") , 但是到了GetObject 说找不到文件,路径是对的,是直接吧文件丢到终端上复制的,不会错。有大佬帮忙修改一下嘛 Mac和Windows都能用的
思路是先删掉对应的工作表,然后再导入,
|
|