Hello Djmarak,
You can use this macro (UDF) on the Worksheet. The macro doesn't check if the file path or file name exist, but you can easily modify it if you need to do this.
Function FileExt(FileName As String) As String
Application.Volatile
Dim FSO As Object
Set FSO = CreateObject("Scripting.FileSystemObject")
FileExt = FSO.GetExtensionName(FileName)
End Function
Place the file name in "A1", and place this formula "B1"
=FileExt(A1)
Adding the Macro
1. Copy the macro above pressing the keys CTRL+C
2. Open your workbook
3. Right Click on any Sheet's tab
4. Left Click on View Code in the pop up menu
5. Press the keys ALT+I to activate the Insert menu
6. Press M to insert a Standard Module
7. Paste the code by pressing the keys CTRL+V
8. Make any custom changes you need to the macro
9. Save the Macro by pressing the keys CTRL+S
Sincerely,
Leith Ross
Bookmarks