+ Reply to Thread
Results 1 to 7 of 7

Remove 'marching ants' from copied cell

  1. #1
    Registered User
    Join Date
    12-07-2012
    Location
    London, England
    MS-Off Ver
    Office 2010
    Posts
    81

    Remove 'marching ants' from copied cell

    Hi,

    I have a button with a single line of code to copy the contents of a cell for a user to paste elsewhere (probably a Word doc).

    How can I make the 'marching ants' vanish from around the cell that was copied.

    If I add a line to the button macro to make cut/copy mode false it does remove them, but also removes the value from the clipboard!

    How can I get round this?

    Help appreciated.

  2. #2
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: Remove 'marching ants' from copied cell

    Two suggestions:
    • Store the value(s) in named constants...(similar to named ranges, but instead of a range reference you put the value you want to store)
    • Store the value(s) someplace in the workbook for later retrieval

    Does that help?
    Ron
    Former Microsoft MVP - Excel (2006 - 2015)
    Click here to see the Forum Rules

  3. #3
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: Remove 'marching ants' from copied cell

    Hi, staggers47,

    I´d suggest to copy the ranges directly via Value. The command needed could be either of these two (they both work equally)
    Please Login or Register  to view this content.
    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

  4. #4
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,168

    Re: Remove 'marching ants' from copied cell

    Hi staggers47,

    Try this:
    If the cell to copy is C2 then instead of doing a
    Range("C2").Copy alone, Try a,
    Rance("C2").Copy Destination:=Range("C2") instead.
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  5. #5
    Registered User
    Join Date
    12-07-2012
    Location
    London, England
    MS-Off Ver
    Office 2010
    Posts
    81

    Re: Remove 'marching ants' from copied cell

    Haha!

    Hi again Ron. Used your second idea. Put it in a sheet the user will never go to and then copied it from there. It had the ants, but it doesn't matter there. And as soon as a new word turns up the ants go away. And on the original screen they're using, they don't appear in the first place, of course, which is the important thing.

    Thanks once again!

    To HaHoBe & MarvinP: Thanks for your replies. They turned up in rapid succession just after I'd already used Ron's.

    Thanks again to all.
    Last edited by staggers47; 01-13-2013 at 12:13 PM. Reason: Adding thanks!

  6. #6
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: Remove 'marching ants' from copied cell

    I'm glad I could help (again).

  7. #7
    Registered User
    Join Date
    01-26-2017
    Location
    Baton Rouge, LA, USA
    MS-Off Ver
    2010
    Posts
    6

    Re: Remove 'marching ants' from copied cell

    I was having the same problem. I put it in some hidden cells on the primary sheet that the user can't access when the sheet is protected - worked like a charm!

+ 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