DOSYA İndirmek/Yüklemek için ÜCRETLİ ALTIN ÜYELİK Gereklidir!
Altın Üyelik Hakkında Bilgi
[SIZE="2"]Private Sub CommandButton1_Click()
Set a = CreateObject("scripting.filesystemobject")
Set dic = CreateObject("scripting.dictionary")
dic.CompareMode = vbBinaryCompare
n = 1
dic.Add n, "E:\DENEME\"
geri:
h = dic.Count
For j = n To h
If a.GetFolder(dic(j)).Name <> [COLOR="Red"]"A"[/COLOR] Then
Set klasor = a.GetFolder(dic(j))
If klasor.Subfolders.Count > 0 Then
For Each alt In klasor.Subfolders
If alt.Name <> [COLOR="Red"]"A"[/COLOR] Then dic.Add dic.Count + 1, alt
Next: End If:
End If: Next
If h < dic.Count Then
n = h + 1: Set klasor = Nothing:
GoTo geri: End If
Cells(1, 2).Resize(dic.Count) = Application.Transpose(dic.Items)
End Sub [/SIZE]
Sayın Plint merhaba,
listelenmesini istediğimiz klasörün path'ini A1 hücresine girerek listelemek istesek aynı kodları nasıl değiştirmemiz gerekir acaba?
Private Sub CommandButton1_Click()
Set a = CreateObject("scripting.filesystemobject")
Set dic = CreateObject("scripting.dictionary")
dic.CompareMode = vbBinaryCompare
n = 1
dic.Add n[COLOR="Red"], [A1].Value[/COLOR]
'....
'... diğer kodlar
[SIZE="2"] Private Sub CommandButton1_Click()
Set a = CreateObject("scripting.filesystemobject")
Set dic = CreateObject("scripting.dictionary")
dic.CompareMode = vbBinaryCompare
n = 1: v = v + 1
dic.Add n, [COLOR="Red"]"C:\Documents and Settings\"[/COLOR]
geri:
h = dic.Count
[COLOR="Red"]On Error Resume Next[/COLOR]
For j = n To h
If a.GetFolder(dic(j)).Name [COLOR="Red"]<> "A"[/COLOR] Then
Set klasor = a.GetFolder(dic(j))
If klasor.Subfolders.Count > 0 Then
For Each alt In klasor.Subfolders
If alt.Name [COLOR="Red"]<> "A" [/COLOR]Then
v = v + 1
Cells(v, "A") = alt.DateLastModified
Cells(v, "B") = alt
dic.Add dic.Count + 1, alt
End If
Next:
End If
End If: Next
If h < dic.Count Then
n = h + 1: Set klasor = Nothing:
GoTo geri: End If
[COLOR="Red"]a = Cells(Rows.Count, 1).End(xlUp).Row
Range("A1:B" & a).Sort Key1:=Cells(1, 1), Order1:=xlDescending[/COLOR]
End Sub[/SIZE]