View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
John John is offline
external usenet poster
 
Posts: 141
Default Is it Possible Q

Andrew, thanks for your code, but it doesn't seem to do anything. I have
placed it within code for sheet "Access Log", but it doesn' seem to do
anthing i.e. I have a blank sheet for "Access Log" when I open / close it


"Andrew" <NoToSPAM@home wrote in message
...
Try this....

There must be a worsheet in the workbook with the title "Access Log":

Private Sub Workbook_Open()
x = Sheets("Access Log").Cells(1, 2) ' cell B1 holds log count
Sheets("Access Log").Cells(x + 2, 1) = Format(Now(), "ddd-dd/mmm/yy
hh:mm:ssampm")
Sheets("Access Log").Cells(x + 2, 2) = Application.UserName ' ** Display
User who opened file
Sheets("Access Log").Cells(1, 2) = x + 1 ' Increment Log count ' **
Increment Log count
Sheets("Access Log").Visible = xlVeryHidden ' *** Hides the Access Log
worksheet
ActiveWorkbook.Save ' *** Save Changes to Log ** Note User may also
save
after any user changes
End Sub

Hope this helps.. adding everyones views I hope.
Andrew


"Vacation's Over" wrote in
message
...
| Bob offered good code but it does allow manual input as well to type in
| yesterday's date
|
| i would run this in the "background" without visibility
|
| if you are ok with Excel
|
| you might want to include a hidden worksheet for this information
| additionally if you set teh font to "white" even if they open the sheet
they
| will not see the records
|
| If you are good with Excel or VBA you may want it to write to a separate
| file or even send you an email notification when fiile is opened
|
| "Bob Phillips" wrote:
|
| Private Sub Workbook_Open()
| Dim iLast As Long
| With Worksheets("Sheet1")
| iLast = .Cells(.Rows.Count, "A").End(xlUp).Row + 1
| If iLast = 2 Then
| If .Range("A1") = "" Then
| iLast = 1
| End If
| End If
| .Range("A" & iLast).Value = Format(Now, "dd mmm yyyy
hh:mm:ss")
| End With
| End Sub
|
| 'This is workbook event code.
| 'To input this code, right click on the Excel icon on the worksheet
| '(or next to the File menu if you maximise your workbooks),
| 'select View Code from the menu, and paste the code
|
| --
| HTH
|
| Bob Phillips
|
| "John" wrote in message
| ...
| Is it possible to Time stamp a sheet to indicate everytime a
worksheet
has
| been opened?
|
| I have a file which users should be using daily, but I suspect they
are
| not
| (although they tell me they are!) so I was wondering if I could
build
a
| database within that file that would timestamp an area of a
worksheet
| every
| time the file was actually opened (as opposed to everytime it was
saved,
| as
| they might not have to save it everytime), say A1 in Sheet1, so the
second
| time they access/open the file in would stamp A2 in Sheet1 etc etc
|
| Hope someone can help
|
|
|
|
|
|