Me.ListBox_FilesFound(lCounter - 1, 0) = sFile
Private Sub FillListBox_FilesFound()
On Error GoTo Err_Proc
Dim sFileName As String
Dim sFilePath As String
Dim lCounterFileTotal As Long
Dim lCounter As Long
Dim sFileOnly As String
Dim colFiles As New Collection
Dim vFile As Variant
Dim sFile As String
'setting up listbox:
Me.ListBox_FilesFound.ColumnCount = 2
Me.ListBox_FilesFound.ColumnWidths = "0;100"
Me.ListBox_FilesFound.Clear
sFileName = GetCurrentFileName
'determine path
sFilePath = FilePathOnly_feo(sFileName)
txtFilePath = sFilePath
RecursiveDir colFiles, sFilePath, "*.xls*", True
lCounterFileTotal = colFiles.Count
lCounter = 0
'loops through all files found in RecursiveDir
'but only through filenames that have states.
For Each vFile In colFiles
sFile = vFile
lCounter = lCounter + 1
sFileOnly = FileNameOnly_feo(sFile)
Me.ListBox_FilesFound.AddItem
Me.ListBox_FilesFound(lCounter - 1, 0) = sFile
Me.ListBox_FilesFound(lCounter - 1, 0) = sFileOnly
If IsNameOfUSStates(sFileOnly) = True Then
ListBox_FilesFound(lCounter - 1, 0).Selected = True
DoEvents
End If
Next vFile
'lCounter = 0
Exit_Proc:
Exit Sub
Err_Proc:
Call LogError_feo(Err, Err.Description, "fAdjustFiles @ FillListBox_FilesFound")
Resume Exit_Proc
End Sub
ee-error1.PNGNetwork and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.
”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.
Our community of experts have been thoroughly vetted for their expertise and industry experience.