ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Saving copied info while running a Selection Change Macro (https://www.excelbanter.com/excel-programming/326787-saving-copied-info-while-running-selection-change-macro.html)

J Streger

Saving copied info while running a Selection Change Macro
 
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!
--
*********************
J Streger
MS Office Master 2000 ed.
MS Project White Belt 2003


Bernie Deitrick

Saving copied info while running a Selection Change Macro
 
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


"J Streger" wrote in message
...
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!
--
*********************
J Streger
MS Office Master 2000 ed.
MS Project White Belt 2003





All times are GMT +1. The time now is 05:26 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com