Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 63
Default A macro that counts the number of times a file is opened

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.

  #2   Report Post  
Posted to microsoft.public.excel.misc
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.


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 340
Default A macro that counts the number of times a file is opened

Just a caution - if a user has macros disabled (Excel's default), your macro
will not run

Bob Flanagan
Macro Systems
144 Dewberry Drive
Hockessin, Delaware, U.S. 19707

Phone: 302-234-9857, cell 302-584-1771
http://www.add-ins.com
Productivity add-ins and downloadable books on VB macros for Excel

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.



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Loop Macro a variable number of times thesaxonuk Excel Discussion (Misc queries) 11 October 31st 06 06:05 PM
Using Macro to Save Copy of File to New Location Chris Z Excel Discussion (Misc queries) 3 September 12th 06 11:26 PM
Formula for current month minus one = Quarter number in a macro. Pank Excel Discussion (Misc queries) 11 June 22nd 05 02:47 PM
A new sequence number in file everytime it is opened Tiger Claw Excel Worksheet Functions 1 June 15th 05 03:37 PM
Weekly Transaction Processing Ralph Howarth Excel Worksheet Functions 4 January 19th 05 05:37 AM


All times are GMT +1. The time now is 11:22 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"