+ Reply to Thread
Results 1 to 2 of 2

edit the contents of a cell using a macro

  1. #1
    stinson
    Guest

    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. #2
    sebastienm
    Guest

    RE: 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 to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1