View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default delete all spaces in range

Can you just use Edit|Replace to replace all the space characters (match entire
cell, though) with nothing?

Select the range first.

"J.W. Aldridge" wrote:

need to change this to fit all cells in named range "apples".

Sub NoSpaces()
Dim c As Range

For Each c In Selection.Cells
c = Replace(c, " ", "")
Next
End Sub


--

Dave Peterson