Saving copied info while running a Selection Change Macro

J

J Streger

I am using the Worksheet_SelectionChange subroutine to change the contents of
a cell dependent upon the location of the active cell. This has the
unfortunate side effect that eliminates the ability to copy/cut and paste,
except for fill right/down.

I know how to determine if the selection change was preceeded by cut/copy
(by seeing if the application is in cutcopymode), but I wanted to know if
there was a way to capture the copied/cut information into a variable prior
to it being lost by the rest of the code. I assume a property saves this
information as a string or array but I can;t find it. thanks!
 
B

Bernie Deitrick

J,

You could use a hidden workhseet to paste the clipboard contents prior to
running your code. Then when you need the range again, copy it from the
hidden worksheet. That's the technique that John Walkenbach (Excel guru)
uses in his undo routine.

HTH,
Bernie
MS Excel MVP
 

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