-----Original Message-----
I have a spreadsheet that Has a column of No's that look
like this AB 12 45 87 B the column has about 30,000 No 's
in it. I want the No's to look like AB124587B so that they
do not have the spaces in, any way of doing this un excel.
Mani
Change the references to the following code as neccessary.
It is written to work on column B from row 2
Option Explicit
Dim r As Long, col As Integer
Sub clearSpaces()
Dim rng As Range
Dim c
Dim n As Integer, l As Integer
Range("B2").Select 'Change this to suit it should be
the column with part numbers
r = Application.WorksheetFunction.CountA(Range("B:B"))
col = ActiveCell.Column
Set rng = Range(Cells(2, col), Cells(r, col))
For Each c In rng
c.Replace What:=" ", Replacement:="", LookAt:=xlPart,
SearchOrder:= _
xlByRows, MatchCase:=False
Next c
End Sub
Regards
Peter