GET date from filename

Hi,
I have a file as filenamex - filenamey-date
how to write vba code to get date from filename in column A till end of the row.
please help

You shouldn't need VBA for

You shouldn't need VBA for this. To get the current workbook filename you can use the formula =CELL("filename"). Depending on your date format, you should be able to use something like =RIGHT(CELL("filename"),10) to take the last 10 characters from the filename.

Chris