aşagıdaki kodla texti excele import ediyorum. fakat yeni bir excel sayfası acarak yapabildim benim istediğim. yolunu verdiğim bir *.xls ye ulaşarak
textedi verileri "A1" sutunundan başlayarak sırayla aktarması...
Sub GetTxtData2()
Dim MyFile As String
MyFile = "C:\Test.txt"
j = 0
Set NewSh = Worksheets.Add
j = j + 1
NewSh.Name = "TextSheet-" & j
Open MyFile For Input As #1
Do While Not EOF(1)
I = I + 1
Line Input #1, InputData
Cells(I, 1) = InputData("1")
If I > 65535 Then
Set NewSh = Worksheets.Add
j = j + 1
NewSh.Name = "TextSheet-" & j
I = 0
End If
Loop
Close #1
Set NewSh = Nothing
End Sub
textedi verileri "A1" sutunundan başlayarak sırayla aktarması...
Sub GetTxtData2()
Dim MyFile As String
MyFile = "C:\Test.txt"
j = 0
Set NewSh = Worksheets.Add
j = j + 1
NewSh.Name = "TextSheet-" & j
Open MyFile For Input As #1
Do While Not EOF(1)
I = I + 1
Line Input #1, InputData
Cells(I, 1) = InputData("1")
If I > 65535 Then
Set NewSh = Worksheets.Add
j = j + 1
NewSh.Name = "TextSheet-" & j
I = 0
End If
Loop
Close #1
Set NewSh = Nothing
End Sub