View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Mike H Mike H is offline
external usenet poster
 
Posts: 11,501
Default saving cell value for use later

Hi,

Alt+F11 to open Vb editor. Double clicj 'ThisWorkbook' and paste the code
below in on the right.

Private Sub Workbook_BeforeClose(Cancel As Boolean)
Dim Sh As Object
Set Sh = Sheets("Sheet1")
With Sh
.Range("A1").Value = Range("A3").Value
.Range("A2").ClearContents
End With
End Sub

Mike
"MitzDriver" wrote:

I have a worksheet that has a simple formula. In a1 is xxxnumber, a2 is
xxxnumber in a3 is =a1+a2. When i close the workbook I need to save the value
in a3 so that when i reopen the workbook, a2 is blank and a1 contains the
value from a3 in the previous workbook. Hope that made since.
Thanks for any suggestions.