Dim strFileName As String
Dim strFolder As String
Dim iCount As Integer
strFolder = "C:\MyFolder"
strFileName = Dir$(strFolder & "\*.xl")
Do Until strFileName = ""
iCount = iCount + 1
strFileName = Dir$()
MsgBox "There are " & iCount & " relevant files in the folder"
Open in new window
Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.
If you are experiencing a similar issue, please ask a related question
Join the community of 500,000 technology professionals and ask your questions.
Join & Ask a Question
Join our community for more solutions or to ask questions.
For immediate help use Live now!