Date Feature (Conditional)

Dolphin123

New Member
Joined
Jun 21, 2010
Messages
37
Consider 3 columns of data (a,b,c). Column a has a numerical value that creates the text content in column b (column b has an IF statement). For column c, I would like to populate the date at which a numerical value is entered in column a and then freeze on that date unless column a is updated in the future. Anyone know how this would be accomplished.

Added wrinkle: considering task above can be done, what if I only wanted to show the date if column a is <2 or =4 (otherwise keep as blank).

Thank you!
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
Right click the sheet tab, select View Code and paste in

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 1 Then
    If Target.Value < 2 Or Target.Value = 4 Then
        Application.EnableEvents = False
        Target.Offset(, 2).Value = Date
        Application.EnableEvents = True
    End If
End If
End Sub
 
Upvote 0
Hi VoG,

You are playing a game I am not familiar with; a whole other level. I can see the area where you indicate paste the code, but have no idea what the next step is, nor how I would reflect this formula in cells c2 to bottom of the spreadsheet column. It is not even clear to me how your code makes reference to column a (versus another column) for the numerical value? Any further insight? Maybe this one is beyond my current skill level and need to park as a future challenge.
 
Upvote 0
It checks if the column number that you entered something in is 1 (A) then writes the date two columns to the right (C) provided that the value in A is less than 2 or equal to 4.

If that isn't what you asked for, I'm sorry.
 
Upvote 0
Excellent, I had to change column number to 14 (way spreadsheet was configured) but the code works like a charm. Thank you!
 
Upvote 0

Forum statistics

Threads
1,224,586
Messages
6,179,730
Members
452,939
Latest member
WCrawford

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