How do I clear cell content when excel document is closed?

M

m3155

I am trying to clear the content of some "data" cells when I close the excel
document, without having to go to "edit,clear,content" route. Is this
possible?
 
S

Springbok

Hold and click Ctrl+F11 to open the VB editor. In the 'Project - VBA Project
window" find and double click on "ThisWorkbook". Then paste this code...
(Change range to suite)

Private Sub Workbook_Close()
Range("E6:G15").Select
Selection.ClearContents
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