Dates in excel

swingkat

New Member
Joined
Sep 18, 2006
Messages
29
Hello,

I'm would like to write a function that automatically writes the date an action is taken. In other words, it would be something like:

=IF(D12="x";TODAY(); ) but the problem is I need the date to remain as a static value, which is why I can't use TODAY or NOW. I'm stumped because the only way to write a static date that I have found is using the keyboard command CTRL+SHIFT+; and I can't include that sequence in the IF function or in VBA.

If anyone could help me with this I would be really grateful as I've been wrestling with this problem for two whole days without any luck. It seems so simple......
 
double click
Code:
Option Explicit

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)

Dim cell As Range
Dim CheckRange As Range
Dim TC As Long

Set CheckRange = Intersect(Target, Union(Columns("D"), Columns("L"), Columns("T")))

If CheckRange Is Nothing Then Exit Sub

Cancel = True

Application.EnableEvents = False

    With Target
    .Value = "x"
    .Offset(0, 1) = Time
    End With

Application.EnableEvents = True

End Sub
a variation on this theme would be to put a checkmark in the cells
Code:
    With Target
    RH = .RowHeight
    .Font.Size = 10
    .Font.Name = "Marlett"
    .RowHeight = RH
    .Value = "a"
    .HorizontalAlignment = xlCenter
    .VerticalAlignment = xlCenter
    .Offset(0, 1) = Time
    End With
 
Upvote 0

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN

Forum statistics

Threads
1,215,711
Messages
6,126,401
Members
449,312
Latest member
sweetfriend9

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