I am trying to extract a two or three letter string from another string.
In one column (A) I have a list of two or three letter strings.
In the adjacent column (B) I have a combination of the known string and the target string.
The value in column B is in the format STRING$STRING. All strings are either a two or three letter combination. The two strings will never be the same. The $ sign is a unique character.
In my mind the VBA code will work by first finding the location of the $ sign. Next the code will look to the left of the $ and make a note of the two or three letter string, then the code will repeat the same process but to the right of the string. Next the code will compare the two strings to the string in column A, and the unique string will be recorded in column B.
Example 1:
Column A: SD
Column B: SD$HYT
New Column B: HYT
Example 2:
Column A: HYT
Column B: HVY$HYT
New Column B: HVY
The difficulty I am having regards identifying how many characters my column B strings are.
The cell begins with a string, followed by the $ sign, followed by the second string, followed by a space, followed by a varying amount of text.
Given that both strings are always situated between the beginning of the cell and the $ sign, and the $ sign and a space, I just need to be able to extract the letters characters between the mentioned “boundaries.”
Bookmarks