Search for part of a string in a range and insert value.

Status
Not open for further replies.

DaveUK

Board Regular
Joined
Jan 24, 2005
Messages
245
Please could someone tell me how to do the following in VBA.
I have searched for a solution all to no avail.

I want to search column D on a worksheet from D3 to the last row of data in column D.

I want to search for "ML" occuring in each cell in the range (as above). If "ML" occurs in the active cell i then want to put "MAIN LINE" into the G column on the same row and then continue searching until an empty cell is found in Column D.

Please note i need to find "ML" even if it is embedded by other letters/numbers BUT only if they occur as "ML".
Eg.

VALID 225ML , 6ML, MLSB, T6ML3 etc

Many Thanks for any advice.

[/code]
 

Some videos you may like

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
Status
Not open for further replies.

Watch MrExcel Video

Forum statistics

Threads
1,118,086
Messages
5,570,136
Members
412,305
Latest member
Mozz
Top