PDA

View Full Version : Solved: Find Text



remy988
02-13-2013, 09:26 AM
Hi,

in my column A, i have many strings that will contain the word part or parts but can be anywhere within the string. i need to extract the data after the word part or parts.

how can i write this in vba?

thanks

re

CodeNinja
02-13-2013, 10:11 AM
Remy,
You can use mid and instr to parse the data you want. In the following example, Resultstring will hold the result and findstring is the string you are looking for in the cells. Address should be written (row, column) you are searching through.

ResultString= Mid(Cells(address), InStr(1, Cells(address), FindString) + Len(FindString) + 1)

remy988
02-13-2013, 10:15 AM
CodeNinja,

very nice! thanks


remy