VBA Parsing text for value

sgolder

Board Regular
Joined
Oct 31, 2002
Messages
151
Hiya,

Basically i have the message from an outlook mail body item that i need to search for a certain number within it.

The number can be anything from 2000 to 5000, but i want to search through the text until i come accross the first instance of the value and write it to a textbox. But im not to know what the number is as someone else will be feeding these numbers when they email me, so i need to scroll through the email pick up the number and then display some relevant data.

i.e. the no i might be searching for in an email is 4131. Need VBA code to search through the email then when it finds the 4 digit code it puts it in the textbox.

Can anyone help?

Stu
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December

Forum statistics

Threads
1,195,848
Messages
6,011,951
Members
441,657
Latest member
Diupsy

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
Top