请测试!
Sub wanao2008()
Dim txtLine, FileObj, TextObj, FilePath
Dim regEX As Object, mc1, mc2, hs As Integer
Dim MyStr As String, Lie As Integer
Set regEX = CreateObject("VBSCRIPT.REGEXP")
Set FileObj = CreateObject("Scripting.FileSystemObject")
regEX.Global = True
regEX.Pattern = "\t"
'设置模块2的起始列和行
Lie = 10
hs = 3
FilePath = ThisWorkbook.Path & "\需要导入的内容.txt"
Set TextObj = FileObj.OpenTextFile(FilePath, 1, True)
Do While Not TextObj.AtEndOfLine
'读取行内容
txtLine = TextObj.readline
Set mc2 = regEX.Execute(txtLine)
If Cells(hs, mc2.Count + Lie) = "" Then
Cells(hs, mc2.Count + Lie) = Trim(txtLine)
Else
Cells(Cells(20, mc2.Count + Lie).End(xlUp).Row + 1, mc2.Count + Lie) = Trim(txtLine)
End If
Loop
TextObj.Close
Set TextObj = Nothing
Set FileObj = Nothing
End Sub