Avatar of Seamus2626
Seamus2626
Flag for Ireland asked on

ThisWorkbook.name

Hi, i have this formula in the VBA editor

.Range("U1").Formula = DateSerial(Mid(ThisWorkbook.Name, 13, 4), Mid(ThisWorkbook.Name, 11, 2), Mid(ThisWorkbook.Name, 9, 2))

The code opens another file which im trying to read the date off, one of the problems, is that because the above formula is in the editor of my core spreadsheet, thats spreadsheet name its trying to read. So i need it to be amended so it can read the active workbooks name

Thanks
Seamus
Microsoft Excel

Avatar of undefined
Last Comment
Seamus2626

8/22/2022 - Mon
jppinto

Dim wk as Workbook
Set wk = ActiveWorkbook
ASKER CERTIFIED SOLUTION
jppinto

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Seamus2626

ASKER
Excellent, thanks Jppinto!

Seamus
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck