• [VBA]批量转换xls为csv


    Option Explicit

    '批量转换文件夹中的xls为csv

    Sub covertFile(ByRef sFilename As String)
    Dim oWorkbook As Workbook
    Set oWorkbook = Workbooks.Open(Filename:=sFilename)
    oWorkbook.SaveAs Filename:
    =sFilename & ".csv", FileFormat:= _
    xlCSV, CreateBackup:
    =False
    oWorkbook.Close
    False
    End Sub

    Sub covertFiles()
    Dim sPath As String
    Dim sDir As String
    sPath
    = "K:\Desktop\List"
    sDir
    = Dir(sPath & "\*.xls")
    While Len(sDir)
    Debug.Print sDir
    covertFile sPath
    & "\" & sDir
    sDir
    = Dir
    Wend
    End Sub

  • 相关阅读:
    Windows下使用nmake编译C/C++的makefile
    poj 1228
    poj 1039
    poj 1410
    poj 3304
    poj 1113
    poj 2074
    uva 1423 LA 4255
    poj 1584
    poj 3277
  • 原文地址:https://www.cnblogs.com/snippet/p/xls2csv.html
Copyright © 2020-2023  润新知