Need to Capture the initial value of a cell.

D

dpk2307

HI,

I need to capture the initial value of a cell into another cell an
store it permanently even if the parent cell value is changed any numbe
of times.
For Ex: When the sheet was opened, say the A1 value was 25, then sam
should be assigned to B1, when I change A1 any number of times, stil
the B1 value should be 25 itself
 
R

Ron Rosenfeld

HI,

I need to capture the initial value of a cell into another cell and
store it permanently even if the parent cell value is changed any number
of times.
For Ex: When the sheet was opened, say the A1 value was 25, then same
should be assigned to B1, when I change A1 any number of times, still
the B1 value should be 25 itself.

You need to use VBA to do that. One way is with a worksheet selection_change event code.

To enter this event-triggered Macro, right click on the sheet tab.
Select "View Code" from the right-click drop-down menu.
Then paste the code below into the window that opens.

====================================
Option Explicit
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Not Intersect(Target, [a1]) Is Nothing Then
If [b1].Text = "" Then
[b1].Formula = "=IF(A1="""","""",A1)"
Else
[b1].Value = [b1].Value
End If
End If
End Sub
===============================
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top