ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   wildcard substitution in formula (https://www.excelbanter.com/excel-programming/319552-wildcard-substitution-formula.html)

Jeff

wildcard substitution in formula
 
I have the following worksheet name that is used to identify the file ie: "If
xlApp.Workbooks("CPCT Dec CDART.xls")" I would like to be able to use a
wildcard ("*") o0perator in place of the word Dec, so that I can open the
workbook whatever month it is, since there is always only one file in the
folder and its name only changes based upon the month.

How should I approach this.

Jeff

Peter T

wildcard substitution in formula
 
Hi Jeff,

Instead of wildcard try:

Dim sFilename As String
sFilename = "CPCT " & Format(Date, "mmm") & " CDART.xls"

also take a look at the 'Like' function

Regards,
Peter T

"Jeff" wrote in message
...
I have the following worksheet name that is used to identify the file ie:

"If
xlApp.Workbooks("CPCT Dec CDART.xls")" I would like to be able to use a
wildcard ("*") o0perator in place of the word Dec, so that I can open the
workbook whatever month it is, since there is always only one file in the
folder and its name only changes based upon the month.

How should I approach this.

Jeff





All times are GMT +1. The time now is 12:40 AM.

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