gibbo1715
09-06-2005, 05:45 AM
I ve tried to add the code from Jakes (Dr J's) progress bar to my code, can anyone tell me why the below will not work?
Sub FindTextString()
Dim i As Integer
Dim szSearchWord As Variant
Dim ThisPath As String
Dim ThisName As String
Dim Savename As String
Dim sFollder As String
Dim Total1 As Long
Dim Total2 As Long
Dim x As Long
Dim y As Long
Dim MyTimer As Double
Dim NodeFullPath As String
Dim nod As Node
Dim MyPath, NodeName, parent As String
Dim n, k As Integer
Total1 = 20
Total2 = 1000
sFollder = GetFolderPath
If sFollder <> vbNullString Then MsgBox sFollder
ThisPath = ThisWorkbook.Path
ThisName = ThisWorkbook.Name
Savename = ThisPath & "\" & ThisName
szSearchWord = Application.InputBox("What are you looking for ?", "Search", , 100, 100, , , 2)
If szSearchWord = False Then
Sheets("Sheet1").Select
End
End If
With Application.FileSearch
.NewSearch
' For x = 1 To Total1
' For y = 1 To Total2
' MyTimer = Timer
' Me.TextBox4.Width = (y / Total2) * 200
' Me.Label2.Caption = "Calculating Data: " & y & " of " & Total2
.LookIn = sFollder
.FileType = msoFileTypeAllFiles
.SearchSubFolders = True
.TextOrProperty = szSearchWord
.Execute
' Next y
' ProgressBar.TextBox2.Width = (x / Total1) * 200
' ProgressBar.Label1.Caption = "Updating: " & x & " of " & Total1
' Next x
MsgBox "There were " & .FoundFiles.Count & " file(s) found."
End With
Cheers
Gibbo
Sub FindTextString()
Dim i As Integer
Dim szSearchWord As Variant
Dim ThisPath As String
Dim ThisName As String
Dim Savename As String
Dim sFollder As String
Dim Total1 As Long
Dim Total2 As Long
Dim x As Long
Dim y As Long
Dim MyTimer As Double
Dim NodeFullPath As String
Dim nod As Node
Dim MyPath, NodeName, parent As String
Dim n, k As Integer
Total1 = 20
Total2 = 1000
sFollder = GetFolderPath
If sFollder <> vbNullString Then MsgBox sFollder
ThisPath = ThisWorkbook.Path
ThisName = ThisWorkbook.Name
Savename = ThisPath & "\" & ThisName
szSearchWord = Application.InputBox("What are you looking for ?", "Search", , 100, 100, , , 2)
If szSearchWord = False Then
Sheets("Sheet1").Select
End
End If
With Application.FileSearch
.NewSearch
' For x = 1 To Total1
' For y = 1 To Total2
' MyTimer = Timer
' Me.TextBox4.Width = (y / Total2) * 200
' Me.Label2.Caption = "Calculating Data: " & y & " of " & Total2
.LookIn = sFollder
.FileType = msoFileTypeAllFiles
.SearchSubFolders = True
.TextOrProperty = szSearchWord
.Execute
' Next y
' ProgressBar.TextBox2.Width = (x / Total1) * 200
' ProgressBar.Label1.Caption = "Updating: " & x & " of " & Total1
' Next x
MsgBox "There were " & .FoundFiles.Count & " file(s) found."
End With
Cheers
Gibbo