merhaba Arkadaşlar siteden aldığım aşağıdaki kodu excel 2007 de çalıştıramıyorum yardım edermisiniz.
kod:
Private Sub CommandButton1_Click()
On Error Resume Next
Call Liste(ThisWorkbook.Path, "")
MsgBox "işlem tamam"
End Sub
Private Sub Liste(Klasor As String, Uzanti As String)
Dim Hedef As Object, Kaynak As Object, dosya As String, sat As Long
Set Hedef = CreateObject("Scripting.FileSystemObject").getfolder(Klasor).SubFolders
Dim wb As Workbook
dosya = Dir(Klasor & "\*.**" & Uzanti)
While dosya <> ""
DoEvents
If ThisWorkbook.Name <> dosya Then
Cells(1, Cells(1, Columns.Count).End(xlToLeft).Column + 1).Value = dosya
sayfaadi = "Sayfa11"
son = Application.ExecuteExcel4Macro("COUNTA('" & Klasor & "\[" & dosya & "]" & sayfaadi & "'!c1)")
deg = "'" & Klasor & "\[" & dosya & "]" & sayfaadi & "'!R"
For s = 2 To son + 1
aranan = ExecuteExcel4Macro(deg & s & "C" & 1)
For j = 2 To Cells(Rows.Count, "a").End(3).Row
If j <> 16 Then
If j <> 21 Then
If j <> 35 Then
If j <> 45 Then
bulunan = Cells(j, 1).Value
If aranan = bulunan Then
For i = 2 To 19
If i <> 9 Then
If i <> 13 Then
If IsNumeric(ExecuteExcel4Macro(deg & s & "C" & i)) = True Then
Cells(j, i).Value = Cells(j, i).Value + ExecuteExcel4Macro(deg & s & "C" & i)
End If
End If
End If
Next i
End If
End If
End If
End If
End If
Next j
Next s
End If
dosya = Dir
Wend
On Error GoTo sonraki
For Each Kaynak In Hedef
Call Liste(Kaynak.Path, "")
sonraki:
Next
Set Hedef = Nothing
End Sub
kod:
Private Sub CommandButton1_Click()
On Error Resume Next
Call Liste(ThisWorkbook.Path, "")
MsgBox "işlem tamam"
End Sub
Private Sub Liste(Klasor As String, Uzanti As String)
Dim Hedef As Object, Kaynak As Object, dosya As String, sat As Long
Set Hedef = CreateObject("Scripting.FileSystemObject").getfolder(Klasor).SubFolders
Dim wb As Workbook
dosya = Dir(Klasor & "\*.**" & Uzanti)
While dosya <> ""
DoEvents
If ThisWorkbook.Name <> dosya Then
Cells(1, Cells(1, Columns.Count).End(xlToLeft).Column + 1).Value = dosya
sayfaadi = "Sayfa11"
son = Application.ExecuteExcel4Macro("COUNTA('" & Klasor & "\[" & dosya & "]" & sayfaadi & "'!c1)")
deg = "'" & Klasor & "\[" & dosya & "]" & sayfaadi & "'!R"
For s = 2 To son + 1
aranan = ExecuteExcel4Macro(deg & s & "C" & 1)
For j = 2 To Cells(Rows.Count, "a").End(3).Row
If j <> 16 Then
If j <> 21 Then
If j <> 35 Then
If j <> 45 Then
bulunan = Cells(j, 1).Value
If aranan = bulunan Then
For i = 2 To 19
If i <> 9 Then
If i <> 13 Then
If IsNumeric(ExecuteExcel4Macro(deg & s & "C" & i)) = True Then
Cells(j, i).Value = Cells(j, i).Value + ExecuteExcel4Macro(deg & s & "C" & i)
End If
End If
End If
Next i
End If
End If
End If
End If
End If
Next j
Next s
End If
dosya = Dir
Wend
On Error GoTo sonraki
For Each Kaynak In Hedef
Call Liste(Kaynak.Path, "")
sonraki:
Next
Set Hedef = Nothing
End Sub
