HI
I would like to extract the date from the filename to a column BL and I've got a variable lDestLastRow to find the last row.
The file and path gets allocated to a Variant fileNameAndPath
Now I would like to extract the date at the end of the file normally "Text Here 21.09.22.xlsx" or the filename can also be " Text 21.9.2022.xlsx" then put a value in Column BL as -> 21-SEP-22 (dd-mmm-yy)
Thanks in advance
I would like to extract the date from the filename to a column BL and I've got a variable lDestLastRow to find the last row.
The file and path gets allocated to a Variant fileNameAndPath
VBA Code:
Dim fileNameAndPath As Variant
fileNameAndPath = Application.GetOpenFilename(FileFilter:="Excel Files (*.XLSX), *.XLSX", Title:="Select File To Be Opened")
If fileNameAndPath = False Then Exit Sub
'Workbooks.Open Filename:=fileNameAndPath
Set wbCopy = Workbooks.Open(Filename:=fileNameAndPath, ReadOnly:=True)
Set wsCopy = wbCopy.Worksheets(1)
Now I would like to extract the date at the end of the file normally "Text Here 21.09.22.xlsx" or the filename can also be " Text 21.9.2022.xlsx" then put a value in Column BL as -> 21-SEP-22 (dd-mmm-yy)
Thanks in advance