Here is my code and I know it bombs out on the
MyFile= portion. But what is wrong? It seems I'm missing something pretty obvious here? By the way in the combobox I have xls doc ppt and so on.
Sub how_many()
MsgBox NumOfFiles("H:"
& " files in your H:"
End Sub
Function NumOfFiles(Path As String) As Long
UserForm1.Show
sext = UserForm1.ComboBox1.Text
Dim MyFile As String
Dim Counter As Long
MyFile = Dir(Path / "*.* & sext"
Do While MyFile <> vbNullString
MyFile = Dir
Counter = Counter + 1
Loop
NumOfFiles = Counter
End Function
For just $19.95 you too can have a beautiful smile.
MyFile= portion. But what is wrong? It seems I'm missing something pretty obvious here? By the way in the combobox I have xls doc ppt and so on.
Sub how_many()
MsgBox NumOfFiles("H:"
End Sub
Function NumOfFiles(Path As String) As Long
UserForm1.Show
sext = UserForm1.ComboBox1.Text
Dim MyFile As String
Dim Counter As Long
MyFile = Dir(Path / "*.* & sext"
Do While MyFile <> vbNullString
MyFile = Dir
Counter = Counter + 1
Loop
NumOfFiles = Counter
End Function
For just $19.95 you too can have a beautiful smile.