Bestandnaam eruit filteren

Uit een volledige bestandsnaam, dus inclusief map en bestandsnaam kan via de functie Application.Evaluate de bestandsnaam worden gefilterd.

Function BestandsNaam(Naam As String) As String
Dim v As Variant

'Bestandsnaam uit de naam halen
v = Application.Evaluate("{""" & _
WorksheetFunction.Substitute(Naam, "\", """,""") & """}")

'Het laatste element is de bestandsnaam
BestandsNaam = v(UBound(v, 1))
End Function