Trouble Extracting A String

Brad24

Board Regular
Joined
May 4, 2015
Messages
81
Hi, is there an easy way to extract a name from the following string?

The string has the following format. I just want James Bond out of this string.

James Bond J. Bond
 
Try this formula to place the desired value (not the formula) directly in the cell...
Code:
[table="width: 500"]
[tr]
	[td]Workbooks(MyWorkbook).Sheets(MyWorksheet).Range("O1").Value = Left(Range("A457").Value, InStrRev(Left(Range("A457").Value,Len(Range("A457").Value)-1), ".") - 3)[/td]
[/tr]
[/table]
 
Upvote 0

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
I spot checked and it works. Can you tell me why these Ranges aren't correct?

Code:
For j = StartRow + 3 To EndRow + 2 Step 3
    Workbooks(MyWorkbook).Sheets(MyWorksheet).Range("N" & j).Value = Left(Range("A" & j).Value, InStrRev(Left(Range("A" & j).Value, Len(Range("A" & j).Value) - 1), ".") - 3)
Next j
 
Upvote 0
I spot checked and it works. Can you tell me why these Ranges aren't correct?

Code:
For j = StartRow + 3 To EndRow + 2 Step 3
    Workbooks(MyWorkbook).Sheets(MyWorksheet).Range("N" & j).Value = Left(Range("A" & j).Value, InStrRev(Left(Range("A" & j).Value, Len(Range("A" & j).Value) - 1), ".") - 3)
Next j

What do you mean by "aren't correct"? What is happening... or not happening... that makes you ask that question?
 
Upvote 0
I figured it out. It was looking at the rows that had the number sign like #12 etc, and was failing instead of the rows with the names in them.

Thanks for your help! I appreciate you staying with this one.
 
Upvote 0

Forum statistics

Threads
1,224,825
Messages
6,181,190
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top