Hey I would like to extract some characters from the cell B26 . I hope it is not much trouble..
B26 = C:\Users\User Name\Desktop\12-2020 (user.name).xlsm
I want to extract 2 characters that comes before "-" which is 12
Then I want to extract 4 characters that comes after "-" which is 2020
I would like to extract the filepath which is C:\Users\User Name\Desktop\
Will appreciate plenty and thanks.
Please note B26 is not consisting of any formula but the value is just giving a filename without the sheet name.
for instance using the code
B26 = C:\Users\User Name\Desktop\12-2020 (user.name).xlsm
I want to extract 2 characters that comes before "-" which is 12
Then I want to extract 4 characters that comes after "-" which is 2020
I would like to extract the filepath which is C:\Users\User Name\Desktop\
Will appreciate plenty and thanks.
Please note B26 is not consisting of any formula but the value is just giving a filename without the sheet name.
for instance using the code
VBA Code:
Worksheets("HSheet").Range("B26") = ThisWorkbook.FullName