+ Reply to Thread
Results 1 to 2 of 2

Create a calendar in a range of cells

  1. #1
    Forum Contributor
    Join Date
    06-17-2010
    Location
    Dallas, TX
    MS-Off Ver
    Excel 2010
    Posts
    157

    Create a calendar in a range of cells

    I'm creating a virutal calendar using VBA and putting the dates into a range of cells. I've written a macro that starts off alright but it won't end the loop on the last day of the month. BTW, I know that I can create a userform that would perform these functions for me, but (as strange as it sounds) I'm doing this for fun. I've written the code myself, but can't figure out what I'm doing wrong.

    I've attached a sample sheet.

    Please Login or Register  to view this content.

    ... and as always, any tips for how I can write the code more efficiently is appreciated. I'm open to all forms of constructive criticism. It helps me write more robust macros.
    Attached Files Attached Files
    Last edited by Ricker090; 08-08-2011 at 12:46 PM. Reason: Solved

  2. #2
    Forum Contributor
    Join Date
    06-17-2010
    Location
    Dallas, TX
    MS-Off Ver
    Excel 2010
    Posts
    157

    Re: Create a calendar in a range of cells

    Nevermind, I solved it by changing the formula in cell B1 to show the last day of the month as a date instead of the "day" and corrected the last if statement accordingly.

    In case anyone was interested, here's the new code:

    Please Login or Register  to view this content.

    Additionally, if anyone has any suggestions on how I may improve upon this code please feel free to post a response.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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