Date and Timestamp at worksheet level

ashlad

Board Regular
Joined
Aug 22, 2002
Messages
56
I have a workbook which is being used by a number of users. Each worksheet is owned by a user and managed by a administrator. When a change is made to a worksheet, I need a timestamp for date and time on saving. This has to be at the worksheet level and each worksheet must have its own individual timestamp (not an overall workbook save timestamp).

Hope you can help.

TIA

Ashlad
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
WELCOME TO THE BOARD!

One way you can do this is with a Worksheet_Change Macro like this:

Range("A1").Value = Now()

This will put the time/date stamp in cell A1.

Is this what you were looking for?
 
Upvote 0
On 2002-08-23 00:34, ashlad wrote:
I have a workbook which is being used by a number of users. Each worksheet is owned by a user and managed by a administrator. When a change is made to a worksheet, I need a timestamp for date and time on saving. This has to be at the worksheet level and each worksheet must have its own individual timestamp (not an overall workbook save timestamp).

Hope you can help.

TIA

Ashlad

Hi Ashlad
Asyou are need to change ALL worksheets then
it is better to use the Workbooks Sheet change event rather then Code for each sheet in the Worksheet_Change event of the Sheet.

eg.
<pre/>
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
Sh.[A1] = Now
End Sub
</pre>
 
Upvote 0
Thanks for the welcome

I need to set the time by sheet and not workbook.

I am not very good with VB, so is the code you specified a formula or do I need to create a piece of vb??

Cheers

Ashlad
 
Upvote 0
Use phantom1975 code and put it in the worksheet code, right click on the sheet tab, view code and paste the code there

Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
Range("A1").Value = Now()
End Sub
 
Upvote 0
that worked thanks a lot.

the problem with it is that everytime you have a change the routine runs twice because the timestamp is also counted. hence you get a small delay as you leave one cell to go to the next.

To solve this i have put a if statement round the command. The code looks like

Private Sub Worksheet_Change(ByVal Target As Range)
If Target <> Cells(5, 4) Then
Cells(5, 4) = Format(Now, "dd mmmm yyyy, hh:mm:ss")
End If
End Sub

the problem I am now having with this, is that you can not take a cell in the sheet and copy across a number of cells as the if statement returns the error "run type error (13) type mismatch"

Any ideas???

Thanks
Ashlad
 
Upvote 0

Forum statistics

Threads
1,214,413
Messages
6,119,372
Members
448,888
Latest member
Arle8907

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