Excel Check if copy envoked

E

Excel User

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
 
D

Dave Peterson

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.
 
E

Excel User

Thanks Dave for your reply,

is it possible to store the current 'selection' then do something and return
to the operation?

Thanks
 
D

Dave Peterson

Maybe you could provide a dedicated macro that would ask for the range to be
copied, then do whatever you wanted and then ask for the paste range and finally
do the paste?
 

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