I'm working in an environment with always follow this hierarchy:
F:\Client Documents\"JobCategory"\"JobNumber-ClientName"\Estimate
Being:
- JobNumber always the 2 digits year follow by 3 sequential digits eg: 15255 (255th job of 2015 )
- JobCategory is used to separate jobs by hundreds, eg, the above job # will be found in folder 15200
- ClientName is the problem, where obviously can be any name...
So at the moment, I have to type correctly the whole job number and name and trough excel I extract the job category and so on... but in order to automatize some other macros. Is there any way where the script finds (or search/match) the first 5 digits and if it match, use that name as a path?
Eg. if I know job # 15255, F:\Client Documents\15200\15255-JohnSmith or \15255-JohnSnow will be a match?
If relevant... the VBA script I have so far to save my workbook is:
Dim JobCat As String, JobDetails As String
JobCat = Sheet12.Range("P4").Text
JobNumber = Sheet12.Range("P5").Text
ActiveWorkbook.SaveAs Filename:= _
"F:\Client Documents\" & JobCat & "\" & JobDetails & "\Estimate.xlsm" _
, FileFormat:=xlOpenXMLWorkbookMacroEnabled, CreateBackup:=False
End Sub
Where in P5
I type the hole JobNumber-ClientName and P4
extract its Number category.
Any help, even to clarify if it's possible will be helpful