Results 1 to 6 of 6

Thread: Macro for copying the contents of a cell to the Windows clipboard

  1. #1
    Junior Member
    Join Date
    Jan 2013
    Posts
    3
    Rep Power
    0

    Macro for copying the contents of a cell to the Windows clipboard

    Hello,

    I have a simple question regarding a way to copy cell contents to the Windows clipboard for use in other applications.

    I have a cell X1 which consolidates information from different cells using a simple concatenation formula. I then want have a macro assigned to button that copies this cell (including formatting such as line breaks, etc.). The macro is simply:

    Code:
    Range("X1").Copy
    This works fine, except that when I paste the text into Notepad for example, the text is preceded and followed by quotation marks: i.e. it pastes "Hello" instead of Hello.

    Is there something I could change to the macro so that these undesirable quotation marks are not added to the text I'm pasting?

    Thanks in advance.

  2. #2

  3. #3
    Junior Member
    Join Date
    Jan 2013
    Posts
    3
    Rep Power
    0
    Quote Originally Posted by rollis13 View Post
    Infact, they shouldn't be there. The quotation marks are there just because of the line breaks. How is your concatenation formula ? can you rearrange it ?
    The formula is:

    =A1&" "&A2&"

    "&A3

  4. #4
    Member rollis13's Avatar
    Join Date
    Nov 2012
    Posts
    36
    Rep Power
    0
    Why couldn't your formula be like this: =A1&" "&A2&" "&A3
    This doesn't have line breaks and doesn't add quotation marks to your copy/paste.

  5. #5
    Junior Member
    Join Date
    Jan 2013
    Posts
    3
    Rep Power
    0
    I actually need the line breaks, the file generates an email, which needs different paragraphs separated by a line break.

  6. #6
    Senior Member
    Join Date
    Jun 2012
    Posts
    337
    Rep Power
    13
    You do not have to copy to use the contents of a cell in Excell.
    Please tell us what the ultimate goal should be and we can suggest mucht simpler 'solutions'.

Similar Threads

  1. Replies: 2
    Last Post: 05-30-2013, 07:28 PM
  2. Replies: 5
    Last Post: 03-09-2013, 09:01 AM
  3. Macro for Opening files and copy the contents of the File
    By ravichandavar in forum Excel Help
    Replies: 16
    Last Post: 08-15-2012, 09:17 PM
  4. Macro to create files as per the contents in a column
    By Praveen Bj in forum Excel Help
    Replies: 1
    Last Post: 07-05-2012, 09:07 PM
  5. Listview not working in Windows 7 - 32 bit
    By Rasm in forum Excel Help
    Replies: 2
    Last Post: 07-09-2011, 07:40 PM

Posting Permissions

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