stamp time in excel tables

karim elb

New Member
Joined
Jun 24, 2016
Messages
4
i am working with tasks in excel table -for example (row 1contains task -to answer i insert row 2 under the task above)-i want to - time stamp in D2
- i hope the answer with formulas -i am beginner in macro
ABCDE
F
G
1




task:how to stamp time ....

2formula?answer:..........
3


<tbody>
</tbody>

thankful because i tried and read many ways without
usefulness
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
what would happen so that a time stamp would be generated, explain the actions
 
Upvote 0
I am sory the answer isn't clear and thanks for response -the task is in cell E1 and I need time and date
generated in D2 when inserting a row
i used a formula in D2 IF(AND(F1<>"Not Done",F1<>""),IF(D2="",NOW(),D2),"") but it appears 1/0/1900 12:00:00 AM
I AM USING EXCEL TABLE

<tbody>
</tbody>
ABCDEFG
1
task:how to stamp time in...

<tbody>
</tbody>
26/26/2016 10:04:00 PManswer:..........
3

<tbody>
</tbody>
 
Upvote 0
Hi,

Your formula isn't working because you have a circular reference, you can't reference the cell D2 within the formula in D2, so the correct formula to use would be:


Excel 2010
DEF
1task:how to stamp time in...
26/26/2016 14:35answer:..........
Sheet1
Cell Formulas
RangeFormula
D2=IF(AND(F1<>"Not Done",F1<>""),NOW(),"")


HOWEVER, that time stamp will be updated each time the workbook is closed and re-opened, thus giving you an incorrect time stamp.
As far as I know, the only way for that time stamp to remain is using VBA.
 
Upvote 0
hi
okay please what is vba that I can use it
Hi karim elb, welcome to the boards.

To do this using VBA you would use a Worksheet_Change event macro. It will be simple enough to explain how to do this, but first I will need you to clarify what cell you want to manually update which will trigger the time stamp. From what I can gather from your earlier posts you will be manually entering the "answer" in cell F2 and you want cell D2 to have the timestamp. If that assumption is correct then this may resolve your issue...

Right-click on the tab for the sheet this is to work on, then select View Code. In the new window that opens, simply copy and past in the following code:

Code:
Private Sub Worksheet_Change(ByVal Target As Range)


If Target.Address = "$F$2" And Target.Value <> "" Then
    Range("D2").Value = Date + Time
End If


End Sub
 
Upvote 0
hi
i do what mentioned by pasting the code after that i don't now how to complete i read the help and other sites no usefulness
sory
 
Upvote 0
After properly pasting the code in the Worksheet module as described by Fishboy in post #6, there's nothing more you need to do.

When you enter the "Answer" in cell F2, cell D2 will automatically give you the time stamp.
 
Upvote 0
Hi karim elb, welcome to the boards.

To do this using VBA you would use a Worksheet_Change event macro. It will be simple enough to explain how to do this, but first I will need you to clarify what cell you want to manually update which will trigger the time stamp. From what I can gather from your earlier posts you will be manually entering the "answer" in cell F2 and you want cell D2 to have the timestamp. If that assumption is correct then this may resolve your issue...

Right-click on the tab for the sheet this is to work on, then select View Code. In the new window that opens, simply copy and past in the following code:

Code:
Private Sub Worksheet_Change(ByVal Target As Range)


If Target.Address = "$F$2" And Target.Value <> "" Then
    Range("D2").Value = Date + Time
End If


End Sub

Hi there thank you very much for the code. it work.. but how can i set more than 1 cell example

Private Sub Worksheet_Change(ByVal Target As Range)




If Target.Address = "$N$5:$N$32" And Target.Value <> "" Then
Range("O5:O32").Value = Date + Time
End If

i want the target address between n5 until n32 and the range is between o5 until 032

thank you very much sir
 
Upvote 0

Forum statistics

Threads
1,214,848
Messages
6,121,917
Members
449,055
Latest member
KB13

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