excel vba - VBA - using a wild card in filename to avoid processing a file -


i looping though number of directories in vba , trying avoid processing 1 file in each directory. first 2 letters of filename changes depending on directory searching. example in 1 directory file called ee-help-me.xlsx , in called f-help-me.xlsx. have tried use wildcard *-help-me have done wrong file processed. have @ code , let me know how fix please?

my code is:

sub listfiles(fld object, mask string) dim fl object 'file each fl in fld.files     if fl.name mask     'open , interrogate file here         if fl.name <> "*-help-me.xlsx" '<<-- not catching when offending file present             debug.print fld.path & "\" & fl.name             'do        end if       end if next end sub 

many thanks

try:

if not fl.name "*-help-me.xlsx" 

Comments

Popular posts from this blog

1111. appearing after print sequence - php -

node.js - Express and Redis - If session exists for this user, don't allow access -

excel - I can't get the attachement of the email PHP -