Click here to Skip to main content
15,881,139 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have this excel form that I'm using to manage computer vulnerabilities. I thought the function i came up with worked fine until the next day when i noticed that using Today() would add the current date.

I need help modifying the below function to leave the date it added and not change it after the next day.

=IF(G18="Mitigated",TODAY(),IF(G18="Escalated",TODAY(),IF(G18="Offline",TODAY(),"")))
Posted
Comments
vbn.saravanakumar 15-May-14 8:09am    
Hi Zachary.shupp,

I have no exact solution. But possible other options are:

- If you are maintaining separate sheet for each day, then please enter current date in a cell. Instead of Today(), we can use that cell.

- We may use a macro to get the date. There we can check whether the cell is already filled with a date. If not filled, we can take that row for processing.
For example:

Dim Counter As Integer
Dim CurrentValue As String

For Counter = 2 To 10
Range("D" & Counter).Select
If ActiveCell.Value = "" Then
CurrentValue = Range("B" & Counter).Value
If CurrentValue = "Mitigated" Or CurrentValue = "Escalated" Or CurrentValue = "Offline" Then
ActiveCell.Value = Now()
End If
End If
Next Counter

But we have to run the macro if any value changed in column B. Otherwise we cannot get correct result.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900