I have managed parsing date (and convert to Excel date format) from the name of imported to Excel text file (path included). For the sake of this post is unnecessary complicate):
=DATE(LEFT(MID(CELL("filename"),FIND("2",CELL("filename")),FIND("_",CELL("filename"))-FIND("2",CELL("filename"))-12),4),MID(MID(CELL("filename"),FIND("2",CELL("filename")),FIND("_",CELL("filename"))-FIND("2",CELL("filename"))-12),5,2),RIGHT(MID(CELL("filename"),FIND("2",CELL("filename")),FIND("_",CELL("filename"))-FIND("2",CELL("filename"))-12),2))
How to move this function to VBA. I have tried formula: Range(""A1").Formula = "=...." and obviously it did not work. Argument of CELL in VBA can't have quotes. Result supposed to go to cell A1 of the ActiveWorksheet.
I would appreciate help/suggestions
Thank you
Tomasz
Bookmarks