View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
sebastienm sebastienm is offline
external usenet poster
 
Posts: 694
Default edit the contents of a cell using a macro

Hi,

Try something like:
Dim cell as Range
set cell = Range("A1") 'range a1 of active sheet
cell.Value = Trim(cell.Text) 'remove trailing spaces with and reassign
to the cell
--
Regards,
Sébastien
<http://www.ondemandanalysis.com


"stinson" wrote:

How can I edit the contents or the string in a cell? For example, if a cell
has text that is followed by blank spaces, I would like a macro to look at
the contents of the cell, look for the blank spaces, and then delete the
blank spaces.