+ Reply to Thread
Results 1 to 3 of 3

Display 'Last Modified' date in worksheet cells

  1. #1
    Registered User
    Join Date
    05-25-2011
    Location
    UK
    MS-Off Ver
    Excel 2010
    Posts
    2

    Question Display 'Last Modified' date in worksheet cells

    Hi

    I've have a workbook containing 5 worksheets and I have allocated a cell in each sheet to automatically display the date that sheet was last modified. This is to allow for each sheet to present a modified date specific to the worksheet rather than the workbook as a whole.

    The code that I have implemented is displaying the "Last Modified: dd mmmm yyyy" string as I require but it is also causing Excel to crash whenever I modify/delete contents from any other cells. I'm not a coder so can anyone assist with debugging the details below please?

    Version
    Excel 2010 (Excel Macro-Enabled Workbook)

    VB Code (against every worksheet)
    Please Login or Register  to view this content.

    Error
    Microsoft Visual Basic
    Run-time error ‘-2147417848 (800 10 108)’:
    Method ‘_Default’ of object ‘Range’ failed

    Followed by ..... Microsoft Excel has stopped working ….. Restart the program


    Any help will be appreciated. Thanks.
    Last edited by Badger72; 05-26-2011 at 03:29 AM. Reason: Added Code Tags

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Display 'Last Modified' date in worksheet cells

    Hello Badger72,

    Welcome to the Forum!

    When using the Worksheet_Change() or Worksheet_SelectionChange() events, you should make it a habit to disable the event at the beginning of the event and re-enable it before exiting the event. Otherwise the event will call itself over and over again causes a stack overflow error. Here is a basic example with error handling.
    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Registered User
    Join Date
    05-25-2011
    Location
    UK
    MS-Off Ver
    Excel 2010
    Posts
    2

    Talking Re: Display 'Last Modified' date in worksheet cells

    Thanks for the advice Leith. This is solved my issue.

    Cheers, Steve

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1