View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Nick Hodge Nick Hodge is offline
external usenet poster
 
Posts: 1,173
Default A macro that counts the number of times a file is opened

Mr Lanier

You could use a Workbook_Open event thus

Private Sub Workbook_Open()
Worksheets("Tracker").Range("A1").Value = _
Worksheets("Tracker").Range("A1").Value + 1
End Sub

This put the value in A1 on a sheet called tracker, remember users have a
habit of changing or deleting stuff, so you may want to hide the worksheet.
To implement, right click on the small Excel icon for the workbook and
select view code. Paste the code here, save and close

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
DTHIS
www.nickhodge.co.uk


wrote in message
ups.com...
Can a macro be written that will count the number of times a file has
been opened? If so, can the count be shown in a designated cell such
as A1. And would the count be affected if the file is saved under a
different name? If you know how to write such a macro, its formulation
would be much appreciated. Thanks.