HTML Code:
HTML Code:
A few questions:
example 1 shows the results as LASTNAME4, adam
what denotes where the info to extract prior to the @ starts? is it any non alpha char? or just space or full stop?
Example2
How does Jennifer appear in the results? its not before an @ or after |,/ ?
In the same way, in Example3 how does LASTNAME7 appear in the results?
If someone has helped you then please add to their Reputation
Example 1 - I need to extract the name prior to the "@". There are no non alpha characters.
Example 2 - I need to extract LASTNAME3 JENNIFER from column A. Which would be the names after the last "-" in Column A
Example 3 - I would need to extract the entire name before the "|"
I think you need to define your extraction criteria exactly how you want it before any solution can be found, my issue with your original post was that the examples didnt match the request therefore there appears to be something thats not been defined.
eg Example 2 doesnt contain any of the characters youve mentioned as being required
yet your desired results show something I wouldnt have expected, Im assuming therefore that - needs to be added to the chars above, and then how do you define the "names" are they single words or 2 words split with a " ", what if theres a middle name? such as WHITFIELD, PETER JOHN etcloop through column A looking for @, |, or / and extract the names before @ and | or the names between /.
Thanks pjwhitfield for your help. I know it's a bit confusing. If column A were all the same I think it would be easier. However, I have 3 different formats/criteria to evaluate in column A. Would this logic work?
Function 1
- Extract text after the last “-“
Function 2
- Extract text between the 2nd “/” and the “@”
Function 3
- Extract prior to 1st “|”
If Find(“-“,A1) Then
ActiveCell.Offset(0,1).Select = Function 1
Else If
Find(“@“,A1) Then
ActiveCell.Offset(0,1).Select = Function 2
Else
Find(“|“,A1) Then
ActiveCell.Offset(0,1).Select = Function 3
End If
Loop thru Column A
I am really lost on this one.
Thanks!
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks