Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default edit the contents of a cell using a macro

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.
  #2   Report Post  
Posted to microsoft.public.excel.programming
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.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
edit the cell contents command in Excel 2007 macro Safia Excel Worksheet Functions 1 March 4th 10 06:48 PM
edit macro to mathc entire cell contents nis75p06 Excel Programming 2 September 3rd 05 04:38 PM
Edit macro to match entire cell contents nis75p06 Excel Discussion (Misc queries) 1 September 3rd 05 04:27 PM
How can I edit cell contents with a macro in Excel? Mind the gaps! Excel Discussion (Misc queries) 2 March 23rd 05 08:51 PM
How can I edit cell contents with a macro in Excel? NotAnExpert Excel Discussion (Misc queries) 1 March 23rd 05 01:17 AM


All times are GMT +1. The time now is 11:08 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"