+ Reply to Thread
Results 1 to 8 of 8

Copy cell value and delete white spaces?

  1. #1
    Registered User
    Join Date
    06-26-2010
    Location
    Montreal
    MS-Off Ver
    Excel 2003
    Posts
    69

    Copy cell value and delete white spaces?

    Hi experts!

    I made a little excel worksheet to make my daily work a little easier. (Excel 97)

    Now I have a simple problem!

    I have a macro applied to a button and when I click on it a cell is copied in the clipboard because I need the data in a different application. The date in the cell is variable and changes depending what I did before I hit the copy button.

    That works great but when I paste the content from the clipboard in another application (ex. notepad) there are a lot of white spaces after the cell content. I need to delete this with spaces before I paste the value in the other application.

    I tried a few times with "Trim" but with no success. I don't know much about macro programming.

    To copy the cell with the macro, I select the cell and then I use the copy funtion.

    How can I delete this white spaces?


    Thank you so much!

    Regards,
    Michael

  2. #2
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Re: Copy cell value and delete white spaces?

    You could try to copy the cell to another blank cell somewhere out of sight, trim it there and then copy to the clipboard.
    Martin

  3. #3
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Copy cell value and delete white spaces?

    Hello gombi,

    Seeing the macro code may yield so insight into the problem. If you can post the workbook that would be best.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  4. #4
    Registered User
    Join Date
    06-26-2010
    Location
    Montreal
    MS-Off Ver
    Excel 2003
    Posts
    69

    Re: Copy cell value and delete white spaces?

    There is not a big thing to post.

    Please Login or Register  to view this content.

    That's what I use to get the value in my clipboard.

  5. #5
    Registered User
    Join Date
    06-26-2010
    Location
    Montreal
    MS-Off Ver
    Excel 2003
    Posts
    69

    Re: Copy cell value and delete white spaces?

    You could try to copy the cell to another blank cell somewhere out of sight, trim it there and then copy to the clipboard.
    Why use a different cell? And how do I trim the content?

    Could someone please help me out?


    Regards,
    Michael

  6. #6
    Registered User
    Join Date
    06-26-2010
    Location
    Montreal
    MS-Off Ver
    Excel 2003
    Posts
    69

    Thumbs down Re: Copy cell value and delete white spaces?

    To fill the cell I use different macros looking like that:

    Please Login or Register  to view this content.

    I did a test with Excel 2007 and there are no white spaces at the end of the content.
    But I can only use Excel 97 at work. It's not possible to change that!

    Any suggestions?

  7. #7
    Registered User
    Join Date
    06-26-2010
    Location
    Montreal
    MS-Off Ver
    Excel 2003
    Posts
    69

    Re: Copy cell value and delete white spaces?

    please could anybody give me a hint.

  8. #8
    Registered User
    Join Date
    06-26-2010
    Location
    Montreal
    MS-Off Ver
    Excel 2003
    Posts
    69

    Re: Copy cell value and delete white spaces?

    It was a merged cell! That caused the problem!

+ 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