Code to get text from part of a cell

K

Keenman

I have a worksheet with data in a column as follows

uid=xvdcfrd,ou=people,dc=xxxxx
uid=sdsdsd,ou=people,dc=xxxxx
uid=fhjetyv,ou=people,dc=xcxcx

Each of the above lines is in a single cell in the column. I need to
start at the top cell and retrieve the text following the first = sign
and grab the text to the first comma (in cell one in the above example,
I want xvdcfrd). After retrieving the text I want to copy/move it to
another column (If I delete the formula, I want to keep the retrieved
data unless there is a way to write the data that I retrieve in the
same column that I am performing this function on). I need the code to
loop through the entire column and grab that data from each cell.

Thanks in advance...
 
B

Biff

Hi!

One way: (assuming every entry starts with uid= and has at least one comma):

=LEFT(SUBSTITUTE(A1,LEFT(A1,4),""),FIND(",",A1)-5)

Copy down as needed.

Not sure what you intend to do about deleting the formulas but you might try
this:

Select the range of formulas
Goto Edit>Copy
Then Edit>Paste Special>Values

This will convert the formulas to constants.

Then you could delete the original data BUT before you do that make sure the
formulas extracted the correct data!

Biff
 
K

Keenman

Biff,

Worked great!!! Thanks...

Hi!

One way: (assuming every entry starts with uid= and has at least on
comma):

=LEFT(SUBSTITUTE(A1,LEFT(A1,4),""),FIND(",",A1)-5)

Copy down as needed.

Not sure what you intend to do about deleting the formulas but yo
might try
this:

Select the range of formulas
Goto Edit>Copy
Then Edit>Paste Special>Values

This will convert the formulas to constants.

Then you could delete the original data BUT before you do that mak
sure the
formulas extracted the correct data!

Biff

"Keenman" <[email protected]> wrot
in
message news:[email protected]...
http://www.excelforum.com/showthread.php?threadid=536246
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top