تحياتي :
وجدت طريقة القراءة من Text file الى Excel وحبيت اعرضها لتروها واذا حب احد انو يستفيد منها
Dim i As Long, lincount As Long
Static lin As Long 'blank line counter
Dim texm As String 'line assigned for variable
Dim tex(1 To 4) 'assign variables to array
lin = 1
Dim vCounter As Integer
vCounter = 1
Set moWB = moApp.Workbooks.Add
moApp.Visible = True
i = FreeFile
Open "c:\foo.txt" For Input As #i
Do While Not EOF(i)
Line Input #i, texm
'find the line separator -- blank line counter
If texm = "" Or texm = Chr$(32) Then lin = lin + 1
'write text to new variable
tex(lin) = texm & vbNewLine
moWB.Sheets("Sheet2").Cells(vCounter, 1).Value = tex(lin)
moWB.Sheets("Sheet1").Cells(vCounter, 1).Value = moWB.Sheets("Sheet2").Cells(vCounter, 1).Value
vCounter = vCounter + 1
'MsgBox tex(lin)
Loop
Close #i
Dim vtext1 As String
Dim vtext2 As String
Dim vtext3 As String
'view data to textbox
vtext1 = tex(1)
vtext2 = tex(2)
vtext3 = tex(3)
'ouput file to new text files
For lincount = LBound(tex) To UBound(tex)
Open App.Path & "\text\newfile" & lincount & ".txt" For Output As #i
Print #i, tex(lincount)
Close #i
Next lincount
