Parse filename 99

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I recall a command that would allow you to break off the filename from a
fullpath filename?

example= c:\cad\cadinput\41873100.DBF

How do I make iexample=41873100.DBF

I can create a function but doesn't VBA have a command to allow you to do
this?
 
One way:

dim Example as string
dim LastBackSlash as long
example = "c:\cad\cadinput\41873100.dbf"
lastbackslash = instrrev(example,"\")
example = mid(example,lastbackslash+1)

This works in xl2k and higher (instrrev() was added in xl2k.
 
Thanks Dave...


--
Ray


Dave Peterson said:
One way:

dim Example as string
dim LastBackSlash as long
example = "c:\cad\cadinput\41873100.dbf"
lastbackslash = instrrev(example,"\")
example = mid(example,lastbackslash+1)

This works in xl2k and higher (instrrev() was added in xl2k.
 
Back
Top