Remove partial data from a cell

R

RodG

I have a list of codes like the following:
12345-1610
64321-1610
etc.
The codes are in a single cell and I need a formula to remove th
"-1610" part. Any help would be greatly appreciated.

Thank
 
D

DDM

Rod, select the cells and Edit > Replace. Find what: -1610. Replace with:
[leave blank]. Click Replace once or twice to test the result. Click Replace
All to do them all
 
R

RodG

Thank you for your response. Can this be done automatically with
formula? The data being imported will be different each time and I d
not want to have to sort, find & replace each time?

Thanks again
 
D

DDM

Rod, a formula like this will do it: =LEFT(A1,FIND("-",A1)-1), followed by
Edit > Copy > Edit > Paste Special > Values > OK.

But you'll probably want a macro or VBA solution. Let's see if "Unresolved"
tempts someone to post one.
 
R

RodG

Thank You!!! That works like a charm. I will be interested to see i
anyone posts a macro solution
 

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