Vincent88
Active Member
- Joined
- Mar 5, 2021
- Messages
- 382
- Office Version
- 2019
- Platform
- Windows
- Mobile
Hi Guys,
My sheet named as 2021(07) and I use below cell function code to extract its year, month and date to a cell C1.
=DATE(LEFT(MID(CELL("filename",A1),FIND("]",CELL("filename",A1))+1,255),4),MID(CELL("filename",A1),FIND("(",CELL("filename",A1))+1,FIND(")",CELL("filename",A1))-FIND("(",CELL("filename",A1))-1),1)
If my sheetname date format changed to 202107, what is the VBA code to extract the date form to 1-Jul to cell D1 and rest of the days (till 31st to cell AH1 and 30-Jun in C1).
Thanks.
My sheet named as 2021(07) and I use below cell function code to extract its year, month and date to a cell C1.
=DATE(LEFT(MID(CELL("filename",A1),FIND("]",CELL("filename",A1))+1,255),4),MID(CELL("filename",A1),FIND("(",CELL("filename",A1))+1,FIND(")",CELL("filename",A1))-FIND("(",CELL("filename",A1))-1),1)
If my sheetname date format changed to 202107, what is the VBA code to extract the date form to 1-Jul to cell D1 and rest of the days (till 31st to cell AH1 and 30-Jun in C1).
Thanks.