title: Loop Through Folders & Subfolders for files with Wildcard Search
body: <p>Good Morning,</p>
  <p>I have some code that is doing the basis of what I want, BUT I just need to take it one step further for it to work perfectly. Currently I'm pulling every file in the folders and subfolders which is proper, but now I need to select only files that have a particular version label: &quot;v5.3.xlsx&quot; so I can open them, make adjustments and close. I've tried every version of a wild card search I can think of but I'm not terribly well versed in VBA so I was hoping someone could kick this over the finish line for me. Any help is very much appreciated!</p>
  <pre><code>    Sub loopAllSubFolderSelectStartDirectory()
  
  'Another Macro must call LoopAllSubFolders Macro to start to procedure
  Call LoopAllSubFolders(&quot;C:\Users\smith\Desktop\Excel Test File\Client\&quot;)
  
  End Sub
  
  'List all files in sub folders
  Sub LoopAllSubFolders(ByVal folderPath As String)
  
  Dim fileName As String
  Dim myFile As String
  Dim fullFilePath As String
  Dim numFolders As Long
  Dim folders() As String
  Dim i As Long
  
  Application.ScreenUpdating = False
  
  If Right(folderPath, 1) &lt;&gt; &quot;\&quot; Then folderPath = folderPath &amp; &quot;\&quot;
  fileName = Dir(folderPath &amp; &quot;.&quot;, vbDirectory)
  
  While Len(fileName) &lt;&gt; 0
  
      If Left(fileName, 1) &lt;&gt; &quot;.&quot; Then
   
          fullFilePath = folderPath &amp; fileName
   
          If (GetAttr(fullFilePath) And vbDirectory) = vbDirectory Then
              ReDim Preserve folders(0 To numFolders) As String
              folders(numFolders) = fullFilePath
              numFolders = numFolders + 1
          Else
              'Insert the actions to be performed on each file
              'This example will print the full file path to the immediate window
              Debug.Print fullFilePath
          End If
   
      End If
   
      fileName = Dir()
  
  Wend
  
  For i = 0 To numFolders - 1
  
      LoopAllSubFolders folders(i)
   
  Next i
  
  Application.ScreenUpdating = True
  
  End Sub
  </code></pre>