Dim count As Integer
StrFile = Dir("C:\Testing\TEST*.csv")
Debug.Print "File name is :" & StrFile
Debug.Print Len(StrFile)
Path = "C:\Testing\"
Debug.Print Dir(Path)
count = 0
Do While StrFile <> ""
count = count + 1
StrFile = Dir("C:\Testing\TEST*.csv")
Loop
Debug.Print "No of Files available --> " & count
If count > 1 Then
MsgBox ("Multiple files found in folder,please delete and keep current date file")
End
End If
If there is one file in the folder, i want the vba code to run and when there are two files I need the vba count to fail
there is some error on count = 0. Any idea how to resolve.
StrFile = Dir("C:\Testing\TEST*.csv")
Debug.Print "File name is :" & StrFile
Debug.Print Len(StrFile)
Path = "C:\Testing\"
Debug.Print Dir(Path)
count = 0
Do While StrFile <> ""
count = count + 1
StrFile = Dir("C:\Testing\TEST*.csv")
Loop
Debug.Print "No of Files available --> " & count
If count > 1 Then
MsgBox ("Multiple files found in folder,please delete and keep current date file")
End
End If
If there is one file in the folder, i want the vba code to run and when there are two files I need the vba count to fail
there is some error on count = 0. Any idea how to resolve.