Avatar of Sandra Smith
Sandra SmithFlag for United States of America asked on

Count characters after the last \ in a string

I have a directory with files of various names.  I need to strip out only the name of the file, but how to I get the name at the end of the directory/file name string.  For example, below
is a fulle name, but I only want what is after the Appr_, that is, I only need Appr_01AB55279_20060803.pdf

"\\sf4\user1\Private\ACH\OID\Repository\SCANNED DOCS\S\Appr_01AB55279_20060803.pdf"

Sandra
Microsoft DevelopmentMicrosoft ApplicationsMicrosoft Access

Avatar of undefined
Last Comment
Sandra Smith

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Rey Obrero (Capricorn1)

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
als315

Or:
Dim A() As String
Dim B As String
B = "\\sf4\user1\Private\ACH\OID\Repository\SCANNED DOCS\S\Appr_01AB55279_20060803.pdf"
A = Split(B, "\")
Debug.Print A(UBound(A))

Open in new window

ASKER
Sandra Smith

This worked.  The Split did not return what I needed.  Thank you both.
Your help has saved me hundreds of hours of internet surfing.
fblack61