wildcard substitution in formula

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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
 

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

Back
Top