View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Don Guillett Don Guillett is offline
external usenet poster
 
Posts: 10,124
Default deleting from within a cell

Sub cleanupnumbers()
'preformat range as text or do it in macro
For Each c In Range("a2:a4")
ms = Right(c, Len(c) - 4)
c.Value = Application.Substitute(ms, "-", "")
Next
End Sub

--
Don Guillett
SalesAid Software

"Completely Confused" wrote
in message ...
I have a column of 5000 part numbers. In each cell contains a part number.
The part numbers looks like this...

1240-00-101-1234
1240-00-102-1234
1240-00-103-1234

I am trying to delete from each cell the dash -
and the first four numbers of the part number so it will look like this

001011234
001021234
001031234