remove a dash from part numbers

G

Guest

I have a database that have part number with dashes (ex. AX-2912) is there
a way to remove the dash?
 
G

Guest

You could use Find/Replace. Find - and leave the Replace With field blank.

Or, you could set up a formula in an adjacent column.

=SUBSTITUTE(A1,"-","")

HTH,
Elkar
 
C

Chip Pearson

You can do it with a formula:

=SUBSTITUTE(A1,"-","")

If you need VBA code to loop through an entire range, use

Sub AAA()
Dim Rng As Range
For Each Rng In Selection.Cells
Rng.Value = Replace(Rng.Text, "-", "")
Next Rng
End Sub

Select the cells with the dashes and then run the code.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
 
G

Guest

Thank you both.

Elkar said:
You could use Find/Replace. Find - and leave the Replace With field blank.

Or, you could set up a formula in an adjacent column.

=SUBSTITUTE(A1,"-","")

HTH,
Elkar
 

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