Locking a generated list after a date

JazzzyJo

Board Regular
Joined
Jul 12, 2011
Messages
60
Hi

I have a column where I generated a list of pay upgrade dates for employes. My formula generate the dates by taking in account what is the status of the employe. That status can change year after years.

I am wondering if there is a way to freeze my list past the "today" date. Meaning that I dont want the date prior to "today" to change. Only the future date on the list to "adapt" depending on the choice done by the employee (the formula generating the list take into account choice made by the user).

Hope I'm clear

Thx
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
Try
Where periods is range name.

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim rCells As Range
    ActiveSheet.Unprotect Password:="Lock"
    '- column for each month
    For Each rCells In Range("Periods").Cells
        If CDate(rCells) <= CDate(Now()) Then
            rCells.Locked = True
        Else
             rCells.Locked = False
        End If
    Next rCells
    
    ActiveSheet.Protect Password:="Lock"
End Sub
 
Upvote 0
I don't know what your table looks like and where the status is held that is used in the formulas. Is the status not tied to a date? (ie each row has a status value)

You could create a macro that runs at startup and changes all calculations refering to paste dates to values. But if you construct your table differently that not all rows refer to only one status value, your problem goes away.
 
Upvote 0
It was my feeling I would have to use VBA. I know nothing about that tho but today is a good day to learn. You guys know a site or a post which have a good tutorial about VBA?
 
Upvote 0
Upvote 0

Forum statistics

Threads
1,224,548
Messages
6,179,445
Members
452,915
Latest member
hannnahheileen

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