Capturing changes in reference cell value

kissthechef

New Member
Joined
Oct 2, 2011
Messages
6
Hi,

I need the solution for the following:

1. Currently I have a randbetween() formula in cell B2.

2. Cell A1 = B2 (Every time the value in B2 changes so does the value in A1)

Instead,
I want that every change in value in cell B2 is captured in progressive cells.

For example:

First iteration in cell B2, value is entered in A1.
Second change in value in B2, value is entered in A2, while value in A1 remains unchanged and so on and so forth

Can any one help?
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
You need to write a macro.

You can use the Worksheet Calculate event to do it though:
Code:
Private Sub Worksheet_Calculate()
    Dim intLastRow As Integer
    
    Application.EnableEvents = False
    
    varCalculation = Application.Calculation
    Application.Calculation = xlCalculationManual
        
    With Worksheets("Sheet1")
        intLastRow = .Range("A65535").End(xlUp).Row
        .Range("A1").Offset(intLastRow).Value = .Range("B2").Value
    End With
    
    Application.Calculation = varCalculation
    Application.EnableEvents = True
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,609
Messages
6,179,874
Members
452,949
Latest member
Dupuhini

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top