ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Directories with wirldcards problems (https://www.excelbanter.com/excel-programming/320706-directories-wirldcards-problems.html)

helen

Directories with wirldcards problems
 
I am having problems with building paths from my variables. I want to use the
wildcard "*" and have it substitute characters between 2 known text strings.
ie. using it to create dynamic directory changing based upon the month of the
year. I am currently using "DateRef = XLMonth & "/" & "*" & "/2005"" with
success, but I cannot get "LeFldr = Left(LeRef, 4) & "_" & "*" & ".xls"" to
work. I simply get the following result . . . "7014_*.xls"

My code is as follows:
Dim LeRef As String
Dim LePth As String
Dim Lefldr as String
Dim DateRef as String
XlMonth as String
DateRef = XLMonth & "/" & "*" & "/2005"
LeFldr = Left(LeRef, 4) & "_" & "*" & ".xls"

Results in "\\v1sacpdofc2\cpdprojects\CIS Financials\QLE\LE\F05
LEs\7014_*.xls\Jan 05\7014_R1B F05 LE_CIS x.xls"


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

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