Home |
Search |
Today's Posts |
|
#1
![]() |
|||
|
|||
![]()
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. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Tue, 19 Mar 2013 10:50:24 +0000, dpk2307 wrote:
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 =============================== |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excel screen capture to capture cells and row and column headings | Excel Discussion (Misc queries) | |||
initial value in a cell with validation | Excel Programming | |||
how to keep the first initial of a name &delete the rest in cell | Excel Discussion (Misc queries) | |||
How can I have an initial zero in an Excel cell? | Excel Discussion (Misc queries) | |||
Run Macro after initial cell edit? | Excel Programming |