Others

How to Automatically Save Daily Stock Portfolio Balances in Excel

Tauseeq MagsiTauseeq Magsi Nov 3, 2026 869 views

Question details

The user needs a method to automatically record and preserve daily snapshots of their stock portfolio balance in Excel.

How to Automatically Save Daily Stock Portfolio Balances in Excel
Product
Microsoft Excel
Device & OS
not provided
Scenario
Tracking historical stock portfolio balances day by day without manual data entry.
Observed behavior
Current Excel formulas dynamically update stock prices and total values, which causes historical daily balances to be overwritten and lost.
Before you start

Ensure your portfolio workbook has a dedicated 'History' worksheet with column headers for the Date and Portfolio Balance, ready to store the extracted daily records.

Solution 1Recommended

Use a VBA Macro to Save Daily Snapshots

Create a VBA script that copies the current date and portfolio balance, pasting them as values into a historical tracking sheet to prevent data from being overwritten.

Since Excel does not have a standard built-in function to capture a static daily snapshot of changing formula outputs, a VBA macro is the most reliable way to automate this process.

1
Open the VBA Editor

Press ALT + F11 on your keyboard to open the Visual Basic for Applications (VBA) editor, then click Insert > Module.

2
Write the snapshot script

Write a short VBA script that copies your current balance cell and finds the next empty row in your 'History' sheet.

3
Paste as static values

Use the PasteSpecial xlPasteValues command within your script so that only the raw numbers (not the live formulas) are stored in the history log.

4
Save and automate

Save your file as a Macro-Enabled Workbook (.xlsm). You can assign this macro to a button, or use the Workbook_BeforeClose event to run it automatically whenever you close the file.

Automating the process: For true daily automation without clicking a button, you can use the Windows Task Scheduler to open your workbook at a specific time, combined with an auto-run macro upon workbook open.
Free Microsoft Office alternative

Try WPS Office for Seamless Portfolio Tracking

Looking for a cost-effective way to track your financial data? WPS Office provides a free, lightweight alternative to Microsoft Office, fully supporting advanced spreadsheet functions, historical data analysis, and VBA macro automation without expensive subscriptions.

  1. 1. Download WPS Office: Visit the official WPS website to download and install the free WPS Office suite on your device.
  2. 2. Open your portfolio workbook: Launch WPS Spreadsheet and open your existing .xlsx or .xlsm file to continue where you left off.
  3. 3. Enable macros: If you are using VBA scripts to record daily balances, navigate to the Developer tab and enable macros to run your automations.
100% compatible with Microsoft Excel (.xlsx and .xlsm) file formatsFree and lightweight Microsoft Office alternativeSeamless macro support for automating portfolio snapshotsFamiliar user interface with zero learning curve for Excel users
microsoft office alternative - wps office

Frequently Asked Questions

Why do my Excel formulas overwrite my previous portfolio balances?

Excel formulas update dynamically based on live or current data feeds. When a stock price changes, the formula recalculates immediately. This means the previous day's balance is lost unless you manually copy and paste it as a static value or use an automation script to save it.

Can I use the STOCKHISTORY function in older versions of Excel?

No, the STOCKHISTORY function is a dynamic array function available exclusively in Microsoft 365 (Office 365) subscriptions and Excel for the Web. Older standalone versions like Excel 2019 or Excel 2016 do not support it.

How do I save a copied formula value as static text?

After copying the cell containing your current balance, right-click the destination cell in your history sheet and select 'Paste Values' (the clipboard icon with a 123 on it), or use the keyboard shortcut Ctrl + Shift + V. This strips away the formula and leaves only the historical number.