AutoRun a macro on Closing

G

Guest

I have recorded a macro. Macro coding given below. All I want to autorun this
macro whenever I close the spreadsheet.



Sub Macro1()
'
' Macro1 Macro
' Macro recorded 3/22/2007 by balaje.rangachari
'
' Keyboard Shortcut: Ctrl+Shift+P
'
Range("C6:C13").Select
Selection.Copy
Range("A6").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Range("C15").Select
Application.CutCopyMode = False
End Sub
 
G

Guest

Hi,
You can use
Private Sub Workbook_BeforeClose (Cancel as Boolean)

.... your code...

End sub
 

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