MSG Box triggered by move/copy

  • Thread starter Thread starter Cameron
  • Start date Start date
C

Cameron

Is there a macro/VBA code I could use that when a person
goes to move or copy a worksheet, a message box appears
with a reminder? Use good ol' "hello world!" as text
example for the msg box.

Thanks in advance

Cameron
 
Well, I'm not sure the full solution, but I'd suggest doing something like
this

Sub test()
Dim myctl As CommandBarControl

On Error Resume Next
Application.CommandBars(29).Controls(5).OnAction = "testing2"
Application.CommandBars(1).Controls(2).Controls(12).OnAction = "testing2"
End Sub

Sub testing2()
MsgBox ("Hello World")
ThisWorkbook.Worksheets(1).Copy destination
End Sub

And you would run the test() sub when you open up the book.
The only thing you need to figure out are how to get the destination for the
copy of the sheet from the user...

or perhaps someone out there knows a what to fire a built-in control's
native action through code, in which case instead of
'thisworkbook.worksheets(1).copy destination' you could just fire the code
for control with ID=848.

Hope this at least gets you started - I'd be interested to hear how to do
it, if someone can provide the way to fire the builtin control's actions.

Mike


--

____________________________________________________________________________
________________
Please reply to newsgroup so everyone can benefit.
Email address is not valid (see sparkingwire.com)
____________________________________________________________________________
________________
 
Back
Top