ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   remove a dash from part numbers (https://www.excelbanter.com/excel-discussion-misc-queries/90615-remove-dash-part-numbers.html)

Mr Happy

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

Elkar

remove a dash from part numbers
 
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


"Mr Happy" wrote:

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


Chip Pearson

remove a dash from part numbers
 
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




"Mr Happy" <Mr wrote in message
...
I have a database that have part number with dashes (ex.
AX-2912) is there
a way to remove the dash?




Mr Happy

remove a dash from part numbers
 
Thank you both.

"Elkar" wrote:

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


"Mr Happy" wrote:

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



All times are GMT +1. The time now is 03:22 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com