return to default when worksheet opened

M

Mark

Is it possible to return a value to a certain default value after it has
been changed and the worksheet has been saved? That is when worksheet
opened, it returns to a given default.



In the below example, using the Present Value of an Annuity, I want Type 1
to revert to Type 0 no matter what is saved. This will save me the erroneous
results when I forget to change it back. However, I want the rest of the
data to remain as saved.



Mark





Present Value of an Annuity

Type 1

Periods per yr 1

Rate 0.065

Nper 10

Period pmt 500

FV

PV $3,828.05
 
C

curllion

When the workbook opened,the macro "workbook_open" can auto run.

Private Sub Workbook_Open()
Msgbox "The workbook has been opened!"
End Sub

When one of the sheets is selected
Private Sub Workbook_SheetActivate(ByVal Sh As Object)
Msgbox "The sheets " & Sh.name & "has been selected!"
End Sub

When one of the sheets is selected
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
MsgBox "The sheets " & Sh.Name & "at the address " & Target.Address & "has
been changed!"
End Sub

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
Msgbox "The sheets will been saved!"
End Sub

U must write these codes into the object "ThisWorkBook"
I am not good at English.Sorry,wish well to you
--
=====================================================
* ÔÚÎÒÇà´ºÄêÉÙµÄʱºò£¬ÓиöÅ®º¢Ô¸ÎªÎÒÈ¥ËÀ¡£ ¡¡¡¡ *
* ËýÒâÖ¾¼á¶¨µØ¶ÔÎÒ˵£¬ÄãÒªÊÇÔÙ²ø×ÅÎÒ£¬ÎÒ¾ÍÈ¥ËÀ£¡ *
* ÔÚÎÒÇîÀ§Áʵ¹µÄʱºò£¬ÓиöÅ®ÈËÔ¸ºÍÎÒ¹²¸°»ÆȪ£¡¡¡¡¡ *
* ËýÕ¶¶¤½ØÌúµÄ¶ÔÎÒ˵£¬ÄãÔÙ²»»¹Ç®£¬ÎҾͺÍÄãͬ¹éÓÚ¾¡£¡*
* *
* ÕŽ¨Æ½ *
=====================================================
 

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