Searching for a character in a string

  • Thread starter Thread starter Kirk
  • Start date Start date
K

Kirk

I need to be able to search for a character in a string
WITHOUT using Mid/Left/Right functions. Is this possible?

My scenario is this, a column is used to store locations
for different documents. I need to be able to find in
that the location the path of the document is, so that if
the user changes the document name, I can replace the
current document name with the new name and utilize the
path.

example:
\\serverX\folderA\subFolderA\SubFolderB\document.abc

In this path, I need to be able to determine the path
(which would be \\serverX\folderA\subFolderA\SubFolderB\)
and the document name (which would be document.abc).

I need to do this without using the Right/Left/Mid
functions since these functions were modifed for XP, I
can't use them since I need the code to be backwards
compatible to XL97.

Any ideas would be appreciated. Thanks.

Kirk
 
Kirk,

check VBA help for the LIKE operator.

if str LIKE "mask" then DOIT else NOGO

constructing the proper mask may take some getting used to.
but then it's simple, fast and effective.

suc6


keepITcool

< email : keepitcool chello nl (with @ and .) >
< homepage: http://members.chello.nl/keepitcool >
 
Back
Top