=LEFT(A1,SEARCH(".",A1)-2)
See if this code line works...aaarrrrrggggghhhhhh.
One of the names has three periods in it. Is it possible to deal with that with this code?
Example
D.J. Kennington D. Kennington
[table="width: 500"]
[tr]
[td]Workbooks(MyWorkbook).Sheets(MyWorksheet).Range("O1").FormulaArray = "=LEFT(R[456]C[-14],MAX(IF(MID(R[456]C[-14],ROW(INDEX(C[-14],1):INDEX(C[-14],LEN(R[456]C[-14]))),1)=""."",ROW(INDEX(C[-14],1):INDEX(C[-14],LEN(R[456]C[-14])))))-3)"[/td]
[/tr]
[/table]
[table="width: 500"]
[tr]
[td]Workbooks(MyWorkbook).Sheets(MyWorksheet).Range("O1").Value = Left(Range("A457").Value, InStrRev(Range("A457").Value, ".") - 3)[/td]
[/tr]
[/table]
Either put select the text an click the button with the # sign or do what the # sign button does and place [/CODE] as the end of the text you want enclosed in the code box and putHow do I get my Code into that format that you have?
IE Code:
and then it goes into that little box.
in front of it. If you wonder why I showed you those in reverse order is because if I put them in correct order, you would not see the codes as this forum's comment processor would have converted them into a code box.
[QUOTE="Brad24, post: 5016661, member: 325210"]I'm playing around with the SPLIT function. I "think" I can read the string into an array and then grab the first two in the array. I don't need the Jr. and that would get me by the names that have D.J. in them
[/QUOTE]
Not necessarily... what if there was (what would be normally) an space between the two initials? Any chance you can post a list of one each of the variances you have in the names text (along with what you want from them) so that we can see all of the varieties you have to work around instead of getting them one at a time like you have been doing?