-
Help with VBA Text Function (Right,Left,Mid)
Hello,
I a trying to select the middle text from a column field and I am getting stuck on the last part.
this is how my names are displayed in my column:
Last_Name,First_Name Middle_Initial
I only want the First Name and the code I have now is:
Right([Names],InStr(1,[Names],",")-2) which returns, First_Name Middle Initial for example Doe,John M = John M
I cant seem to get ride of the Middle Initial any help s greatly appreciated.
Sincerely,
KDC900
-
Dim nms as string
nms = DOE,John M
nms = Right(nms, Len(nms) - Instr(1, nms, ",")) 'Yields, "John M"
nms = Left(nms, Len(nms) - 2) 'Yields "John"
-
Thank you so much for your help Mavila
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules