Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
m3155
 
Posts: n/a
Default How do I clear cell content when excel document is closed?

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?
  #2   Report Post  
Springbok
 
Posts: n/a
Default

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

"m3155" wrote:

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?

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel 2003 FAILS, but Excel 2000 SUCCEEDS ??? Richard Excel Discussion (Misc queries) 2 May 13th 23 11:46 AM
How do I imbed a Word document into an Excel cell? Baxter Excel Discussion (Misc queries) 2 March 12th 05 01:55 PM
Cell Formula reference to cell Based On third Cell Content Gabriel Excel Discussion (Misc queries) 0 February 11th 05 05:35 AM
I have typed in an excel cell and cannot advance to next cell by . aneruth Excel Discussion (Misc queries) 1 January 14th 05 02:34 AM
Copying an Excel spreadsheet to a Word document KG Excel Discussion (Misc queries) 1 November 28th 04 07:38 PM


All times are GMT +1. The time now is 07:49 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"