Yet another Regexp qustion

SReopelle

New Member
Joined
Aug 9, 2018
Messages
5
I've seen the post to find (6 consecutive numbers adjacent to each other in the string) with the solution being:

=LOOKUP(10^6,MID(A1,ROW(INDIRECT("1:"&LEN(A1)-5)),6)+0)

I am trying to find the first 3 digits in a string like this:

text 777 moretext 555.

When I apply the solution above and modify the last section to find 3 digits, it finds the "555". I can't make heads or tails of the expression so I cant' figure out how to modify it to find the first 3 digits.

Can anyone help me with this please?

 
Thank you both for your expert help! I had to save the file as a Macro enabled spreadsheet first. I also had to figure out that the VB uses FirstNNN and the upper example used FirstN. No worries it all worked and I appreciate you taking the time to make me better!
 
Upvote 0

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.

Forum statistics

Threads
1,223,904
Messages
6,175,295
Members
452,632
Latest member
jladair

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