Add Data to Next Row
I have a spreadsheet that is updated everyday with my portfolio balance. The resulting list is used to make charts for me to track my progress.This picks up data from “Named” cells and puts it in the LastPlc row and proper columns.
Sub UpdateRunning()
Dim currDate, LastPlc, AlanAverage, DowJ, NasdaQ
ActiveSheet.Unprotect
Application.ScreenUpdating = False
currDate = Application.Text(Now(), "mm/dd/yy HH:MM")
Sheets("Holdings").Select
LastPlc = Application.CountA(ActiveSheet _
.Range("Y:Y")) + 1 'Find last cell/row plus one
AlanAverage = [ARBave] 'Get amt from Named cell
Cells(LastPlc, 25) = [CurTotl] 'Get amt from Named cell
Cells(LastPlc, 26) = currDate 'Get amt from Named cell
Cells(LastPlc, 29) = [DJI]
Cells(LastPlc, 30) = [nasd]
Cells(LastPlc, 29).Select
ActiveSheet.Protect
Application.ScreenUpdating = True
End Sub
This spreadsheet now has information going back to early 2000 and I can watch progress down and back up again.
|