How to keep/stop random numbers from changing in Excel?
When working with random number formulas in Excel, such as RAND() or RANDBETWEEN(), you may notice that the generated values automatically recalculate and produce new numbers every time the worksheet recalculates. Recalculation can be triggered not only by double-clicking cells, but also by editing cell contents, running calculations, or even opening the workbook. This behavior is often undesirable if you need to preserve a specific set of randomly generated data, for example when preparing datasets for reports, conducting experiments, or distributing shuffled information that should remain unchanged. Here, you’ll find several practical solutions to prevent random numbers from changing, so you can confidently use them for further analysis or sharing.
Stop random numbers changing by Copy and Paste
Stop random numbers changing by setting Calculation Options
Stop random numbers changing by using Insert Random Data of Kutools for Excel ![]()
Stop random numbers changing with VBA code
Stop random numbers changing by Copy and Paste
One of the simplest methods to make random numbers remain constant is by replacing the formulas generating them with their current values. This approach is especially useful when you want a quick solution and don't need to preserve formulas for future reference.
Begin by selecting the cells containing the random numbers that you wish to keep as fixed values. Press Ctrl + C to copy your selection. Next, choose where you want to paste the values—this can be in the original location or in another cell or worksheet. Right-click your target cell or range, then select Paste Special > Values (V) from the context menu. This action converts the formulas to static numbers, preventing further changes regardless of worksheet recalculation.

After performing paste as values, your random numbers are now plain values that will remain unchanged. If you need to apply this method to a large dataset, you can highlight the entire column or range and repeat these steps. This method is best for one-time data preservation, but keep in mind that you cannot recover the original formulas after converting them to values. Consider making a backup if you may need the formulas later.

Unlock Excel Magic with Kutools AI
- Smart Execution: Perform cell operations, analyze data, and create charts—all driven by simple commands.
- Custom Formulas: Generate tailored formulas to streamline your workflows.
- VBA Coding: Write and implement VBA code effortlessly.
- Formula Interpretation: Understand complex formulas with ease.
- Text Translation: Break language barriers within your spreadsheets.
Stop random numbers changing by setting Calculation Options
Another way to keep random numbers from continuously changing is by adjusting Excel’s calculation mode. By default, Excel automatically recalculates formulas whenever any change occurs, which causes random formulas to update frequently. You can alter this behavior so that calculation only happens when you manually request it.
To do this, open your workbook and click the Formulas tab on the Excel ribbon. Then, select Calculation Options, and in the drop-down list, choose Manual.

By switching the calculation mode to manual, Excel stops recalculating all formulas—including random number formulas—automatically. Your currently displayed random numbers will remain unchanged until you explicitly trigger a recalculation by pressing F9 or clicking Calculate Now.
Note:
This setting affects all formulas in the workbook and may delay updates in other cells that rely on dynamic formulas. Use this method when you want to maintain all currently displayed values, not just random numbers, for consistency. Remember to switch back to Automatic calculation when you want formulas to update regularly again to avoid overlooked changes. If only certain random number results need preservation, consider converting those specific cells to values as shown above.
Stop random numbers changing by using Insert Random Data of Kutools for Excel
If you prefer a more user-friendly and flexible approach, especially when generating random data for complex tasks or requiring unique random values, you can utilize the Insert Random Data feature in Kutools for Excel. This powerful function allows you to generate random integers, decimals, dates, text strings, and custom lists—all directly as static values, so they will not change after creation.
1. Select the range where you want to produce random numbers, then navigate to Kutools > Insert > Insert Random Data. 
2. In the Insert Random Data dialog box, choose the type of random data you wish to generate. For example, click on the Integer tab for whole numbers or the Decimal tab for fractional values. Enter your desired range in the From and To fields, such as numbers between 16 and 100. If you wish to prevent duplicates, check the Unique values box. Additional advanced settings allow you to generate random dates, strings, or predefined custom lists as needed. 
3. Click Ok to finalize and generate the random numbers in your selected cells. The inserted numbers are static values and will not change, even when you recalculate the worksheet or reopen the file. 
This approach is especially advantageous when you need to produce various types of random data (not just numeric values) or when you want to ensure the generated random values remain unchanged for further analysis or record keeping. Kutools for Excel offers additional functionalities for generating random dates, text, or custom items. Click here for more details about it. If you ever need to generate random numbers again, simply repeat these steps, with flexible options to fit different scenarios.
Stop random numbers changing with VBA code
For advanced users or when working with large data sets, using a simple VBA macro can instantly convert all random number formulas to static values. This is especially useful for automating repeated tasks or when you frequently generate random data and need those values to be preserved for sharing or record keeping.
1. Click Developer Tools > Visual Basic. In the Microsoft Visual Basic for Applications window, click Insert > Module to add a new code module. Copy and paste the following VBA code:
Sub ConvertRandomNumbersToValues()
Dim Rng As Range
Dim cell As Range
On Error Resume Next
xTitleId = "KutoolsforExcel"
Set Rng = Application.Selection
Set Rng = Application.InputBox("Select random number range", xTitleId, Rng.Address, Type:=8)
For Each cell In Rng
If cell.HasFormula Then
cell.Value = cell.Value
End If
Next cell
End Sub 2. After inserting the code, click the
button to run the macro. When prompted, select the cell range containing your random number formulas. The macro will instantly replace all formulas with their present values, stopping further changes due to recalculation.
In summary, the best solution depends on your specific needs—whether you’re making a one-off copy, adjusting calculation settings across the workbook, needing more tailored random data with Kutools for Excel, or seeking creative formula/VBA strategies for larger tasks. Always consider the implications of turning formulas into values or altering calculation options; make backups of your work as needed to prevent data loss or unintended changes. If you encounter problems such as formulas not locking correctly, random numbers not behaving as expected, or VBA macros not running, check Excel’s calculation settings, macro security, and workbook status for troubleshooting, and try alternative methods outlined above for greater reliability and control.
Relative Articles:
- Generate random even or odd numbers in Excel
- Generate random numbers by given mean and standard deviation in Excel
- Generate random numbers without duplicates in Excel
- Generate random Yes or No in Excel
Best Office Productivity Tools
Supercharge Your Excel Skills with Kutools for Excel, and Experience Efficiency Like Never Before. Kutools for Excel Offers Over 300 Advanced Features to Boost Productivity and Save Time. Click Here to Get The Feature You Need The Most...
Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier
- Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
- Open and create multiple documents in new tabs of the same window, rather than in new windows.
- Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!
All Kutools add-ins. One installer
Kutools for Office suite bundles add-ins for Excel, Word, Outlook & PowerPoint plus Office Tab Pro, which is ideal for teams working across Office apps.
- All-in-one suite — Excel, Word, Outlook & PowerPoint add-ins + Office Tab Pro
- One installer, one license — set up in minutes (MSI-ready)
- Works better together — streamlined productivity across Office apps
- 30-day full-featured trial — no registration, no credit card
- Best value — save vs buying individual add-in