Open Log

jub6

New Member
Joined
Nov 26, 2007
Messages
16
Hi,

I have a workbook in a shared drive.I would like a log in a hidden sheet to tell me who has opened it the last 7 days.

Thanks in advance
J
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
Place this in the ThisWorkbook module.

NB Application.UserName will be dependant on how your IT dept have set up the computers.

Edit the sheet name for your hidden sheet.

Code:
[COLOR=darkblue]Private[/COLOR] [COLOR=darkblue]Sub[/COLOR] Workbook_Open()
   [COLOR=darkblue]Dim[/COLOR] lr [COLOR=darkblue]As[/COLOR] [COLOR=darkblue]Long[/COLOR]
 
   [COLOR=darkblue]With[/COLOR] Sheets("[COLOR=red]Sheet1")[/COLOR]
      lr = .Range("A" & .Rows.Count).End(xlUp).Row + 1
      .Range("A" & lr).Value = Application.UserName
      .Range("B" & lr).Value = Now  [COLOR=green]'time stamp[/COLOR]
[COLOR=green]    '[/COLOR]
[COLOR=green]    'other log information goes here[/COLOR]
[COLOR=green]    '[/COLOR]
   [COLOR=darkblue]End[/COLOR] [COLOR=darkblue]With[/COLOR]
[COLOR=darkblue]End[/COLOR] [COLOR=darkblue]Sub[/COLOR]
 
Upvote 0

Forum statistics

Threads
1,224,618
Messages
6,179,919
Members
452,949
Latest member
beartooth91

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