Merhaba txt okutmam daha önce 2013 versiyonda işlem çok daha kısa sürüyordu.Yaptığım işlem Txt dosyasının 343. satırına kadar okutup excelde ilgili sütunu bulup (yaklaşık 9000 sütun) kopyalıyordum Office 365 te işlem çok uzun sürüyor.Nedeni ne olabilir ?Kodda mı bir sıkıntı var acaba?
Private Sub CommandButton59_Click()
Sheets("Sonuc_Beton").Unprotect Password:="******"
Dim J As Long, k As Long
Close #1
ChDrive ("D:\2019\RAPOR CIKTI\PRES BETON\")
On Error GoTo ErrorHandler
With Application.FileDialog(msoFileDialogOpen)
.InitialFileName = "D:\2019\RAPOR CIKTI\PRES BETON\B*.tst"
If .Show = -1 Then Fileopen = .SelectedItems(1)
End With
Open Fileopen For Input As #1
J = 3
k = 0
Do While Not EOF(1)
k = k + 1
Line Input #1, TextLine
If k > 0 And k < 343 Then
Cells(J, 2) = Replace(TextLine, """", "")
J = J + 1
End If
Loop
Close #1
Dim rFndCell As Range
Dim strData As String
Dim stFnd As String
Dim fCol As Integer
Dim ws As Worksheet
Set ws = Sheets("Sonuc_Beton")
stFnd = ws.Range("B12").Value
With ws
Set rFndCell = .Range("A:MHF").Find(stFnd, LookIn:=xlValues)
If Not rFndCell Is Nothing Then
fCol = rFndCell.Column
ws.Range("B3:B336").Copy ws.Cells(3, fCol)
ws.Cells(3, fCol).Select
Else 'Can't find the item
MsgBox "Bulunamadı"
End If
End With
Exit Sub
ErrorHandler:
MsgBox "RAPOR SEÇMEDİNİZ"
Sheets("Sonuc_Beton").Protect Password:="******"
End Sub
Private Sub CommandButton59_Click()
Sheets("Sonuc_Beton").Unprotect Password:="******"
Dim J As Long, k As Long
Close #1
ChDrive ("D:\2019\RAPOR CIKTI\PRES BETON\")
On Error GoTo ErrorHandler
With Application.FileDialog(msoFileDialogOpen)
.InitialFileName = "D:\2019\RAPOR CIKTI\PRES BETON\B*.tst"
If .Show = -1 Then Fileopen = .SelectedItems(1)
End With
Open Fileopen For Input As #1
J = 3
k = 0
Do While Not EOF(1)
k = k + 1
Line Input #1, TextLine
If k > 0 And k < 343 Then
Cells(J, 2) = Replace(TextLine, """", "")
J = J + 1
End If
Loop
Close #1
Dim rFndCell As Range
Dim strData As String
Dim stFnd As String
Dim fCol As Integer
Dim ws As Worksheet
Set ws = Sheets("Sonuc_Beton")
stFnd = ws.Range("B12").Value
With ws
Set rFndCell = .Range("A:MHF").Find(stFnd, LookIn:=xlValues)
If Not rFndCell Is Nothing Then
fCol = rFndCell.Column
ws.Range("B3:B336").Copy ws.Cells(3, fCol)
ws.Cells(3, fCol).Select
Else 'Can't find the item
MsgBox "Bulunamadı"
End If
End With
Exit Sub
ErrorHandler:
MsgBox "RAPOR SEÇMEDİNİZ"
Sheets("Sonuc_Beton").Protect Password:="******"
End Sub