Changing content of a cell once the current date has passed?

xerxers

Board Regular
Joined
Nov 30, 2005
Messages
140
Hi there,

Could you please assist me.

I work in a department with approx 30 people. I am trying to put together a spreadsheet that will keek track of vacation and various other leave days. Each of these leave days has been given a single alpha code ie V=vacation etc. This spreadsheet also shows RDO's. I have used Conditional formatting so that when a V or P is entered the background changes color. I have also setup a count of the days used which also shows days remaining.
At this time, for next year ALL of the vacation etc is potential, in other words it hasn't happened as yet but is planned.
What I would like to be able to do is once the date of the vaction has come and gone to change that V to VU (Vacation Used) automatically. So that when I look at the actual count per person I can tell instantly What they have used what they have planned and what their remaing Vaction will be.

I am sorry if I have sounded long winded but I wanted to ensure that I explained myself.

I do not know anything about VBA.

If you would like me to forward a copy of the worksheet please let me know.

Thank you.

Rob Mc
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
Is it possible for you to insert another row (or column, depending on how you have your data presented) to evaluate the V's.
something like this:
If a cell has a V and the Vacation Date is < current date, then V, else VU

colbymack
 
Upvote 0
Column B = Date
Column C = Vacation Qualifier (V or P)
Column E = formula

=IF(C7="","",IF(B7<=TODAY(),C7&"U",C7))

Run you count off of column E (hide column E)

Although this does not change the cell... it will update your summary accordingly.
 
Upvote 0
Cell contents

Man...

What quick responses.

Thank you very much. I will try both suggestions and see which is the easiest to implement.

Once agin thank you

Rob Mc
 
Upvote 0
Just for kicks... here is code that will do the trick.

This is placed in the worksheet module and runs when the worksheet is selected.
If you right click the worksheet and click view code.... you can paste this in.

Change the set range to equal the range where your dates are... the offset looks directly to the right for the V or P... so if dates are in column C the column to enter the time off qualifier would be column D or change the offset (0,1) to how many columns over from the date to look.
Add additional else if statements for other qualifiers....

ElseIf c.Offset(0, 1) = "P" Then
c.Offset(0, 1).Value = "PU"

Code:
Option Compare Text

Private Sub Worksheet_Activate()
Dim MyRange As Range
Set MyRange = Range("C6:C13")

For Each c In MyRange
    If c <= Now() Then
        
        If c.Offset(0, 1) = "V" Then
            c.Offset(0, 1).Value = "VU"
        ElseIf c.Offset(0, 1) = "P" Then
            c.Offset(0, 1).Value = "PU"
        End If
    End If
    Next c


End Sub
 
Upvote 0
Cell changes

cfree,

Thank you for the code.

This will tell you just how little I really know about Excel!!!!!!!!!!!

I have clicked on thw wroksheet but how do I view 'view code"........

Rob Mc
 
Upvote 0
Right click on the worksheet title . . . the popup menu that appears should give you a "view code" option.
 
Upvote 0

Forum statistics

Threads
1,214,632
Messages
6,120,655
Members
448,975
Latest member
sweeberry

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