Copy Problems with VB

  • Thread starter Thread starter Greg Hadrych
  • Start date Start date
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.
 
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
 
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?
 
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.
 

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

Back
Top