'显示打开文件夹对话框 With Application.FileDialog(msoFileDialogFolderPicker) .Show Then Exit Sub '未选择文件夹 strFolder = .SelectedItems() End With '获取文件夹中的所有文件列表 varFileList = fcnGetFileList(strFolder) If Not IsArray(varFileList) Then MsgBox "未找到文件", vbInform
Open csvFileName For Input As #1 Dim lineChanger as String lineChanger = Chr(13) fileData = Split(StrConv(InputB(LOF(1), 1), vbUnicode), lineChanger) Close #1 LOF(1), length of file即文件的字节数 InputB,参数1,要读取的字节数:参数2,要读取的文件序号. StrConv,第一个参数字节数组,第二个参数指定转换的
Sub fileCreate2() Dim folderPath, fileName, s As String Dim fs, fo, fc, f As Object folderPath = "C:\Users\ofu1\Desktop\ログ" Open folderPath & "\" & "test02.txt" For Output As #1 Print #1, "fdsaf" Close #1 En
今天项目上有个应用,获取指定Excel文件下的所有sheet的名称以及当前sheet中指定单元格的值,并把他们写到固定的sheet中去,看了下,文件比较多,而且每个文件sheet的个数比较多,也不一样,所以打算写个程序来帮我们实现任务,代码很简单,也写的比较死板.欢迎大家给出意见及你的代码: Sub aaaa() Dim sh1, sh2 As Worksheet Dim shName, cellValue As String 'On Error Resume Next ).Sheets() '