AnsweredAssumed Answered

VBA - String & SubString Manipulation

Question asked by Cad Admin on Jun 21, 2018
Latest reply on Jun 25, 2018 by Cad Admin

I'm looking for some help with string manipulation in regards to extracting a sub-string out of a string.

I need to extract a 6 digit numeric string from a file path.

 

Given.

Path length and verbiage wi always be different.

There will always be only 1 (6) digit numeric string in the path (other numbers will appear

 

Example

X:\Projects\Company\location\Line 1557 Transfer Case Asm Line\Mechanical Design\Design\152655 - Conveyor System\A2500

Z:\Projects\Company\location\1258 Leak tester\Mechanical Design\Design\652875 - Marking System

N:\Projects\Company\location\welding fixture\Mechanical Design\Design\789634 - Test System\A1000

 

Again, Looking to extract the RED (6) Digit numeric sub-string.

 

Side-Note: Thought of possibly extracting between the \ & the -, so extract "\123456 -", then manipulate that string down to 123456...however getting the first initial sub-string is escaping me.

Outcomes