Copy/paste dynamic # over as "text", then auto-update "text" number if dynamic # becomes larger?

Bret1

Board Regular
Joined
Jun 14, 2013
Messages
129
Hello,
I have a file I open and save everyday. I have a column with dynamic numbers (s10:s50). I'd like to keep track of the highest numbers for each row down column (S)...
If I copy column (s) over to column (t) as static text, is there a way to make a condition for each cell in column (t) to update it to the column (s) number if column (s) number turns greater than the static column (t) number? So, column (s) will show dynamic numbers, and column (t) will show the highest number column (s) has ever shown. Thanks!
 

Some videos you may like

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop

pbornemeier

Well-known Member
Joined
May 24, 2005
Messages
3,889
Put this code in the codepage of the worksheet that holds the data. It will update T10:T50 if any cell in S10:S50 changes and is greater than the T-column value in the same row.

VBA Code:
Option Explicit

Private Sub Worksheet_Change(ByVal Target As Range)
    Dim rngCell As Range
    If Not Intersect(Target, Range("S10:S50")) Is Nothing Then
        For Each rngCell In Range("S10:S50")
            If rngCell.Value > rngCell.Offset(0, 1).Value Then rngCell.Offset(0, 1).Value = rngCell.Value
        Next
    End If
End Sub
 

Watch MrExcel Video

Forum statistics

Threads
1,127,331
Messages
5,624,061
Members
416,008
Latest member
PETE91

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
Top