ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Excel Check if copy envoked (https://www.excelbanter.com/excel-programming/423069-excel-check-if-copy-envoked.html)

Excel User[_2_]

Excel Check if copy envoked
 
Hi,

Is it possible to check if when the user clicks a new worksheet
(Worksheet_Activate()) if they have/are coping something - then run
something but then continue the copy command?

i.e.

Private Sub Worksheet_Activate()

'if the user is trying to copy'n'paste something between sheets/workbooks,
first

With ActiveSheet.PageSetup
.LeftFooter = "&Sheet Footer information"
End With

'now continue copy'n'paste

End Sub






Dave Peterson

Excel Check if copy envoked
 
You could use
if application.cutcopymode = xlcut then
(or xlcopy or false)

But the real bad news is that rest of the macro can't do much. Most macros that
do anything will kill the clipboard. So if your code does (almost) anything,
there's a good chance that you're going to kill the paste operation--there won't
be anything left in the clipboard.



Excel User wrote:

Hi,

Is it possible to check if when the user clicks a new worksheet
(Worksheet_Activate()) if they have/are coping something - then run
something but then continue the copy command?

i.e.

Private Sub Worksheet_Activate()

'if the user is trying to copy'n'paste something between sheets/workbooks,
first

With ActiveSheet.PageSetup
.LeftFooter = "&Sheet Footer information"
End With

'now continue copy'n'paste

End Sub



--

Dave Peterson


All times are GMT +1. The time now is 02:08 PM.

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