ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   find file that starts with todays date (https://www.excelbanter.com/excel-programming/432656-find-file-starts-todays-date.html)

LuisE

find file that starts with todays date
 
and activate

this is what i have
For xxx = 1 To Workbooks.Count

If xxx.Name Like Format(Date, yyyymmdd) & .csv Then
xxx.Activate
End If

Next xxx


thanks in advance

Jacob Skaria

find file that starts with todays date
 
Try the below

For Each wb In Workbooks
If wb.Name Like Format(Date, "yyyymmdd") & "*" Then _
wb.Activate: Exit For
Next

If this post helps click Yes
---------------
Jacob Skaria


"LuisE" wrote:

and activate

this is what i have
For xxx = 1 To Workbooks.Count

If xxx.Name Like Format(Date, yyyymmdd) & .csv Then
xxx.Activate
End If

Next xxx


thanks in advance



All times are GMT +1. The time now is 03:15 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com