Deleting Hyphens or Dashes from multiple cells without deleting the remaining content

R

rmaloy

I have a column in excel that has a list of circuit id's. All of these
have hyphens/dashes in them and some are in different locations. (Ex.
13-44M-121-0001, 13-44M1-210-0001) Is there anyway to delete all of the
hyphens/dashes, without having to go into each cell individually? I
still need the characters to remain in order, just without the hyphens.
(Ex. 1344M1210001, 1344M12100001)

Thanks!
 
T

Tom Ogilvy

As long as there are letters in the sequences,

Select all the cells or an area that contains all the cells but not hyphens
you do not want to delete.

then do Edit=>Replace

Replace What: =

Replace With: ' leave blank

Then click OK
 
R

Ray at

This is one way:


Set theRange = Sheet1.Range("A1:D4") ''your range here
For Each oCell In theRange
oCell.Value = Replace(oCell.Value, "-", "")
Next
Set theRange = Nothing
 

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