Incrementing Months and Years

As you know, I love keyboard shortcuts. But I hate entering dates. So I created this little helper. In my new accounting system, they also have shortcut keys for incrementing weeks, months, and years. I don’t have much use for incrementing weeks, but I could kick myself for not thinking of the others. Plus Alt+semi-colon is just sitting there doing nothing.

5 thoughts on “Incrementing Months and Years

  1. Alt+semi-colon is not really sitting there doing nothing. It is the default shortcut to select visible cells only, which can be a real life-saver in those cases where Excel is inconsistent about whether or not it will copy or otherwise interact with the cells that are currently hidden by a filter or other operation.

  2. Dang. Nice catch David. I really should have searched for that instead of just trying it out on some Excel sheets (that obviously didn’t have hidden data). It still may be worth it to me but I really don’t like replacing built-in shortcuts except when it replaces the built-in function. Maybe I’ll get rid of the IncrementYear procedure and use that for months. Thanks for catching that.

  3. there’s no need to check for text, because isdate already checks that (whether a string can be interpreted as date).
    I’d prefer to use the buitlin VBA functions:

  4. Probably more efficient and correct: (in the previous code I used “y”, but I should have used “yyyy”)

    The combination of year & hour
    And the conbination of month & day


Posting code? Use <pre> tags for VBA and <code> tags for inline.

Leave a Reply

Your email address will not be published.