Forum Discussion

kheldar's avatar
kheldar
Iron Contributor
Apr 11, 2022
Solved

wb.Name Like VBA Not Working, Most of the Time

Hello,   This code below sometimes works sometimes doesn't. I don't get why. The file is in CSV format. Also, adding Debug.Print wb.Name line produces a result of the csv file not being display...
  • kheldar 

     

    On the safer side, you may change the logical test as below to remove any leading space in the file name and ignore the letter case and see if this works for you...

     

    If Trim(LCase(wb.Name)) Like "data-*" Then

     

Resources