Filtering VBA

  • Thread starter Thread starter fth
  • Start date Start date
F

fth

Hello,

I would like to filter this search.

there's some folders that it is not necessary.
it begin with "X" or "D" + 5 numbers

Do you have a idea on how to apply this?

many thanks by advance,

Frederic


If (oSubFolder <> "X") Then
For Each oSubFolder In oParentFolder.Subfolders
'Cells(lngR, 1).Value = oSubFolder.Name
Cells(lngR, 1).Value = oSubFolder.Path
lngR = lngR + 1
ListSubFolders oSubFolder, lngR

Next 'oSubFolder
End If
End Function
 
Hi Frederic

Maybe:

If left(oSubFolder.Name,1) <> "X" and left(oSubFolder.Name,1) <> "D" Then

You might need to change .Name to .Path

Regards,
Per
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

filtering in VBA 1
Excel loop Need help 3
Need help with Macro 1
Copy an array into an ADO recordset? 6
list directory in EXCEL 1
Excel VBA help: Text file formatting 19
lastrow function help 6
Excel VBA 1

Back
Top