remove a dash from part numbers

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a database that have part number with dashes (ex. AX-2912) is there
a way to remove the dash?
 
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
 
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
 
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
 
Back
Top