G Guest May 25, 2006 #1 I have a database that have part number with dashes (ex. AX-2912) is there a way to remove the dash?
G Guest May 25, 2006 #2 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 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 May 25, 2006 #3 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
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 May 25, 2006 #4 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 Click to expand...
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 Click to expand...