Link to home
Start Free TrialLog in
Avatar of William C Johnson
William C JohnsonFlag for United States of America

asked on

How do I parse text from one cell to another cell?

I would like to move row by row the space following the number through the closing parenthesis for each row to column B.  Since each line of data is not the same length, how do you write a macro to accomplish the task?  I would like to invoke the Do Until/While function if possible.

            A                                                                  B
25594831  Test.xlsm                                                                  (Too Tall)      
29354138 (Andrew Dillenger)      
22970876 (Olaniyi O Joshua-olagunju)      
27761698 (Charlie M Channington)      
29126146 (Nathan L Budafucco)
Avatar of Flyster
Flyster
Flag of United States of America image

If you would like to do it without VBA you can use this formula. Paste it in B1 and copy down:

=MID(A1,FIND("(",A1)+1,LEN(A1)-FIND("(",A1)-1)

Flyster
You can also utilize the Tsxt to Columns button on the Data ribbon, using "space" as the separator.
Katie, using Space as the separator would split the names across 3 columns in some cases; it would be better to use the ( as a separator. You can then use Find and Replace to get rid of the ) from the end of the result.

Thanks
Rob H
ASKER CERTIFIED SOLUTION
Avatar of Norie
Norie

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Good call, Rob.
Avatar of William C Johnson

ASKER

This solution works the best and it's really fast, too.  Thank you so much.
I think you chose the wrong solution as the accepted solution--it should have been Rob, correct?
No, the best solution was Norie's.  Don't know how to fix that.
Request Attention (at top of page) and ask for question to be re-opened for re-allocation of points.