LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 35,218
Default Before Save code

Open your workbook
hit alt-f11 to get to the VBE
hit ctrl-r to see the project explorer
Select your workbook's project
Insert|module
Paste that code into the newly opened code window.

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

Kelly wrote:

Dave,

What are the steps to create this macro?
--
Kelly

"Dave Peterson" wrote:

One way is to disable events first.

In the VBE
show the immediate window
type this
application.enableevents = false
and hit enter

Then save your file.

Then turn events back on
application.enableevents = True

You may want to create a macro that does the same:

Option Explicit
Option Private Module
Sub SecretSave()
application.enableevents = false
thisworkbook.save
application.enableevents = true
End Sub



Kelly wrote:

I have an excel spreadsheet where I have cells that are mandatory to fill in.
I used the Before Save code in Thisworkbook and it worked. Now how can I
suspend this action so I can save the file myself?
--
Kelly


--

Dave Peterson


--

Dave Peterson


 
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
VBA code to save excel sheet [email protected] Excel Discussion (Misc queries) 1 March 17th 07 04:20 AM
How to save my VBA-code Heine Excel Worksheet Functions 4 September 26th 06 05:46 PM
FILE 'SAVE AS' IN VBA CODE Sally Excel Discussion (Misc queries) 3 June 28th 06 03:41 PM
Macro Save As Code??? Chris Watson Excel Worksheet Functions 2 January 28th 06 10:40 AM
Macro VBA code to name Save-As file Dolores Excel Worksheet Functions 7 December 28th 05 11:24 PM


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

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

About Us

"It's about Microsoft Excel"