Sub Openfile()
fileToOpen = Application _
.GetOpenFilename("Excel Files(*.csv*), *.csv*", MultiSelect:=True)
num = 0
linenumber = 0
For num1 = 1 To UBound(fileToOpen)
num = num + 1
If fileToOpen(num) <> "False" Then
Open fileToOpen(num) For Input As #1 ' Open file for input
Do While Not EOF(1) ' Loop until end of file
linenumber = linenumber + 1
Line Input #1, line
arrayOfElements = Split(line, ",")
elementnumber = 0
For Each element In arrayOfElements
elementnumber = elementnumber + 1
Cells(linenumber, elementnumber).Value = element
Next
Loop
End If
Close #1 ' Close file.
Next num1
End Sub
這是我的程式碼,開出來的都是亂碼
用了錄影巨集
發現跟TextFilePlatform有關
有大神可以幫我嗎作者: samwang 時間: 2021-6-25 13:05