Microsoft Office Excel ® Kod Kılavuzu

Microsoft Office Excel® Code Guide

20 Aralık 2006 Çarşamba

Search For Files




'UserForm1

Option Explicit

Private Sub UserForm_Initialize()
On Error Resume Next
Me.Caption = "[PBİD®] Dosya seçim türü ve sayısı hesabı..."
Application.Visible = False
End Sub
Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
On Error Resume Next
Application.Visible = True
End Sub
Private Sub CommandButton1_Click()
On Error Resume Next
Call SearchForFiles
End Sub
Sub SearchForFiles()
On Error Resume Next
Dim Sayaç As Long
Dim Tür, Bulunan As Double
With Application.FileSearch
.NewSearch
.FileType = msoFileTypeWebPages
.FileTypes.Add msoFileTypeExcelWorkbooks
Tür = .FileTypes.Count
Label2.Caption = Tür
.LookIn = "C:\"
.SearchSubFolders = True
If .Execute <> 0 Then
Bulunan = .FoundFiles.Count
Label4.Caption = Bulunan
ReDim Hafıza(1 To Bulunan, 1 To 1)
For Sayaç = 1 To Bulunan
Hafıza(Sayaç, 1) = .FoundFiles.Item(Sayaç)
'If MsgBox(.FoundFiles.Item(Sayaç), vbOKCancel, "Dosya bulundu") = vbCancel Then
' Sayaç = Bulunan
'End If
If Bulunan > 0 Then ProgressBar1.Value = (100 * Sayaç / Bulunan): DoEvents
Next Sayaç
ListBox1.List() = Hafıza()
Else
Label4.Caption = 0
End If
End With
End Sub

Hiç yorum yok:

Blog Arşivi

Bu gadget'ta bir hata oluştu

Bu Blogda Ara

Contributor

Contributor
Mustafa ULUSARAÇ İstanbul, TÜRKİYE
free counters
T. C. Central Bank Indicative Exchange Rates
Currency Exchange Rate Widget,Currency Converter Widget
Borsa İstanbul