View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Mangesh Yadav[_4_] Mangesh Yadav[_4_] is offline
external usenet poster
 
Posts: 101
Default macro to remove space

Simply start recording a macro, select the entire sheet, go to find /
replace, and replace "school " with "school" (without the double-quotes
ofcourse). Stop recording the macro. Check the macro code which would be
something like this.


Sub Macro1()
Cells.Select
Selection.Replace What:="school ", Replacement:="school", LookAt:=xlPart
_
, SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
End Sub


You could also try running the above code.

Mangesh





"Pawan" wrote in message
...
Hi All

I have an excel sheet with lot of text in cells. e.g. "This is a school
". There is space after word school. Same situation is for many cells. I

want
to remove this space. Is it possible to write a macro for this?

Thank you in advance.

-Pawan