Disclaimer: I am not a programmer, I just find code and attempt to adapt it to my needs.
I found the following code that works for my purpose of saving updating cell values each week, but have run into two problems making it work for my spreadsheet:
1. I need to reference a second sheet for "A4" as A4 is not on the same worksheet as A1, but the code doesn't like something like "Calc"!A4 to point to the other sheet named Calc.
2. I need to create a button to do this "save" manually, but have never used ActiveX command button's before. Not sure where to start there. If its not manual, then it will log a saved entry into my A column on Calc sheet each time I enter a new number on other sheets as A1 is calculated from other cells.
Any help would be greatly appreciated!
Code I found that works partially: "Say we start with A1 and A4 both empty. The following Event macro will allow you to enter a value in A1 and have it appear in A4. Each time the value in A1 is changed, then new value will be copied into the first empty cell below A4. Enter the following event macro in the worksheet code area:"
Private Sub Worksheet_Change(ByVal Target As Range)
Dim A1 As Range, A4 As Range, N As Long
Set A1 = Range("A1")
Set A4 = Range("A4")
If Intersect(A1, Target) Is Nothing Then Exit Sub
Application.EnableEvents = False
If A4.Value = "" Then
A4.Value = A1.Value
Else
N = Cells(Rows.Count, "A").End(xlUp).Row + 1
Cells(N, "A").Value = A1.Value
End If
Application.EnableEvents = True
End Sub
Bookmarks