"Marching ants" around copied cell

R

Riccol

I know this is going to sound dumb but this really bugs me.

When I copy a cell(s), the copied area is highlighted with "marching
ants". Seems that after pasting, the "marching ants" around the source
area should go away, but it doesn't. The only way I can get rid of the
"marching ants" around the source is to click like a madwoman in a cell
adjacent to the ants. Sometimes when I do that though, the clicking goes
awry and I get stuck in a tangle that is very hard to explain, but the
only way out is to close the workbook without saving and then re-open it.

So my question is, what's the right way to get rid of the ants
highlighting the source area after copying?

(Excel 2002)

RC
 
T

T. Valko

I know this is going to sound dumb but this really bugs me.

You're not the only one!

I know I can just hit the Escape key but I use the mouse extensively so I
went so far as to create a button on one of my toolbars that kills the
marching ants! It's a lot faster for me just to use the mouse.
 
R

Riccol

Thanks, Andy. Hitting Escape key quickly kills the ants without having
to click on a cell. I wonder why that little gem isn't in the Help file.
Thanks, I never would have thought to try Escape.
 
R

Riccol

How did you do that? I can see the benefit of killing them with the
mouse rather than having to reach for the Escape key.
 
G

Gord Dibben

Sub Escape()
SendKeys "{ESC}"
End Sub

Alternative..........

Sub Ant_Killer()
Application.CutCopyMode = False
End Sub


Gord Dibben MS Excel MVP
 
T

T. Valko

I use the "Ant_Killer" method!

To the OP:

Do you use macros for anything and if so do you have any of them stored in a
file called Personal.xls?
 
S

Simon Lloyd

The simplest way that requires no extra movement is to put this in th
ThsiWorkbook module
Code
-------------------
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range
Application.CutCopyMode = Fals
End Su
-------------------
right said:
I know this is going to sound dumb but this really bugs me

When I copy a cell(s), the copied area is highlighted with "marchin
ants". Seems that after pasting, the "marching ants" around the sourc
area should go away, but it doesn't. The only way I can get rid of th
"marching ants" around the source is to click like a madwoman in a cel
adjacent to the ants. Sometimes when I do that though, the clickin
goe
awry and I get stuck in a tangle that is very hard to explain, but th
only way out is to close the workbook without saving and then re-ope
it

So my question is, what's the right way to get rid of the ant
highlighting the source area after copying

(Excel 2002

R

--
Simon Lloy

Regards,
Simon Lloyd
'The Code Cage' (http://www.thecodecage.com
 
S

Suleman Peerzade

once you select the cells to be copied and press ctrl+C, you put the cursor
in cell where in you require the data to be pasted, now instead of pressing
Ctrl+V just press enter key and the data would get pasted and also the
marching ants will vanish away without you doing anything else.

If this is a repeated thing for eg. you want to paste the same data two
times then for the first time use ctrl+V and the second time you directly hit
the enter key. This would again do the same thing paste the required data in
the required cell and remove the marching ants without you doing anything
else.
 
R

Riccol

I've never used a Macro before. The spreadsheets I make are mostly just
invoices and ledger stuff for my small (very small) business, no real
complicated formulas or anything, thus I've never tried learning about
Macros.

So the codes posted to kill the ants are greek to me, I don't even know
where I'm supposed to type them. But I'd like to learn what to do with
them if anyone has the time to explain it.

Thanks everyone for your suggestions.

RC
 
S

Simon Lloyd

Press and hold Alt & F11, the VBE (visual basic editor) will open, o
the left you will see a list of your worksheets and on calle
ThisWorkbook, they are all code modules, double click the Thisworkboo
and paste the code i gave

If you are ever given code for a standard module then use Alt+F11 a
before and instead of double clicking Thisworkbook, right click in tha
area, choose Insert and then choose Module, then you can paste your cod
in there. The best way to learn is to record a macro while you are doin
a task and then go back and take a look at the generated code, it's tru
to say that you will see a lot of code that is excess to requirement
but said:
I've never used a Macro before. The spreadsheets I make are mostly jus
invoices and ledger stuff for my small (very small) business, no rea
complicated formulas or anything, thus I've never tried learning abou
Macros

So the codes posted to kill the ants are greek to me, I don't even kno
where I'm supposed to type them. But I'd like to learn what to do wit
them if anyone has the time to explain it

Thanks everyone for your suggestions

R

T. Valko wrote

--
Simon Lloy

Regards,
Simon Lloyd
'The Code Cage' (http://www.thecodecage.com
 
R

Riccol

Thanks, Simon. I'm going to tackle your instructions in the AM and
report back after. (Your method sounds especially good as you say it
kills the ants immediately after pasting.)

RC
 
G

Gord Dibben

The macros provided by Biff and myself are just manually run macros and
should be copied into a General/Standard module, not event type code which
would go into Thisworkbook or a worksheet module.

If you're not familiar with VBA and macros, see David McRitchie's site for
more on "getting started".

http://www.mvps.org/dmcritchie/excel/getstarted.htm

or Ron de De Bruin's site on where to store macros.

http://www.rondebruin.nl/code.htm

In the meantime..........

First...create a backup copy of your original workbook.

To create a General Module, hit ALT + F11 to open the Visual Basic Editor.

Hit CRTL + r to open Project Explorer.

Find your workbook/project and select it.

Right-click and Insert>Module. Paste the code in there. Save the
workbook and hit ALT + Q to return to your workbook.

Run or edit the macro by going to Tool>Macro>Macros.

You can also assign this macro to a button or a shortcut key combo.

I would recommend not using the SendKeys macro.........SendKeys can be a
little flaky. I've never noticed but better safe than sorry.


Gord Dibben MS Excel MVP
 
T

T. Valko

The method that Simon is describing can only be used in the workbook in
which you place the code.

The method I use (which takes more work to setup) can be used in any
workbook.
 
S

Simon Lloyd

Would said:
The method that Simon is describing can only be used in the workbook i
which you place the code

The method I use (which takes more work to setup) can be used in an
workbook

-
Bif
Microsoft Excel MV

--
Simon Lloy

Regards,
Simon Lloyd
'The Code Cage' (http://www.thecodecage.com
 
T

T. Valko

Would that be the same if the code was saved in PERSONAL.xls?

???

I'm not following you.
 
S

Simon Lloyd

I hadn't tried it, i thought that all code stored in the PERSONAL.xl
was available in each workbook you open. This may be crude but how abou
putting that Thisworkbook code in the .xlb file? as this is the bas
file that excel references when starting (or at least thats what
presume) wouldn't every workbook you open already be populated with tha
code

T. Valko;186952 said:
Doesn't work that way for me. It only works in the Personal.xls file

-
Bif
Microsoft Excel MV




Cage Forums' (http://www.thecodecage.com/forumz/showthread.php?t=50724

--
Simon Lloy

Regards,
Simon Lloyd
'The Code Cage' (http://www.thecodecage.com
 
T

T. Valko

The *.xlb file is a file that stores information about toolbars and menus.

What you could do is create a new default book.xlt template and put the code
in there. Save the book.xlt file in the Excel startup directory. Then every
*new file* will have the code available but already existing files won't
have it.

Eh, that doesn't sound too "cool"! I'm sure you'd want to have this
available to *every* file. The only way I know how to do that is what I've
done and create a toolbar button and attach the macro.

It's more of an "ergonomics" issue with me. It's easier to use the mouse to
click the button then to have to look away to the keyboard and "find" the
ESC key!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top