Copy Problems with VB

G

Greg Hadrych

Not sure what is going on but I cannot figure it out. I
have a worksheet where I will enter in a large amount of
numbers. After one macro runs that will sort them, I want
to be able to manually select and copy those numbers I
want and paste them into another worksheet in the same
workbook. I am able to copy and paste the numbers in the
same sheet fine but when I copy and go to the other sheet,
I am not able to paste. Then when I go back to the
original sheet with the numbers, the "marching ants" the
surround my selection is no longer there.

The only time I can copy the number is if I put the
document into Design mode, but by doing this I loose all
my macros.

Not sure if this is a VB thing or what but I am at a loss.
 
B

Bernie Deitrick

Greg,

It could be a VBA thing, if you have a worksheet activate/deactivate event
on either of your worksheets.

HTH,
Bernie
MS Excel MVP
 
G

Greg Hadrych

I do have a sheet with activate/deactivate events, but not
on the sheets i am trying to copy from/to. Is there vb
code that allows copying or to block copying?
 
D

Dave Peterson

From a response to a very similar question:


My first guess is that you have some events that are running (maybe a selection
change or worksheet activate???).

Lots of macros clear the clipboard.

By going into design mode, you're into "development mode" and macros (including
events) won't be running.

You could verify this:
Open excel with macros disabled
(close excel)
windows start button|Run
excel /safe

Or even just disabling events (temporarily).
Hit alt-f11 to see the VBE
hit ctrl-g to see the immediate window
type this and hit enter

application.enableevents = false

Then back to excel and test it out.

When you're done testing, turn the event handling back on. (True in the
immediate window.)

Else your workbook won't work as designed.
 
Top