Consulting

Results 1 to 7 of 7

Thread: Building a Calendar in Excel?

  1. #1

    Building a Calendar in Excel?

    I have a fairly involved question. I'm trying to create a payroll calendar. The way it's meant to work is that users start by viewing a calendar. When they click on a day, they get a menu with 1) a drop-down list of employee names, and 2) two blanks for entering when they started and stopped working).

    What I need help with is:

    * Making the calendar areas clickable (do I use a command button, or something else?)
    * Making a menu with the options I mentioned (names from a different sheet in the workbook, blanks for times).
    * Automatically entering the results into a different spreadsheet.

    Thanks for your help!

  2. #2
    Moderator VBAX Master georgiboy's Avatar
    Joined
    Mar 2008
    Location
    Kent, England
    Posts
    1,199
    Location
    May i start by saying, Welcome aboard

    I hope the attatched file will answer your questions.

    If you would like a more worksheet orientated calendar then let me know as this is a different kettle of fish.
    Click here for a guide on how to add code tags
    Click here for a guide on how to mark a thread as solved
    Click here for a guide on how to upload a file with your post

    Excel 365, Version 2403, Build 17425.20146

  3. #3
    Moderator VBAX Wizard lucas's Avatar
    Joined
    Jun 2004
    Location
    Tulsa, Oklahoma
    Posts
    7,323
    Location
    Why not put the calendar on a userform? You can used the calendar control.
    Steve
    "Nearly all men can stand adversity, but if you want to test a man's character, give him power."
    -Abraham Lincoln

  4. #4
    Moderator VBAX Wizard lucas's Avatar
    Joined
    Jun 2004
    Location
    Tulsa, Oklahoma
    Posts
    7,323
    Location
    Here's an alternative to georgiboys file. His uses the excel calendar control which sometimes causes problems if you send the file to someone else who doesn't have the calendar control installed.

    If you are not going to be sharing it then that solution will work fine. If you are going to be sending it out to other users you might want to try something like the attached.

    Note: I didn't refine it for your purpose as Georgiboy did but it is a good example and easy to alter to your needs usually.


    For a previous discussion on problems with calendar control see this thread:
    http://www.vbaexpress.com/forum/showthread.php?t=10914
    Steve
    "Nearly all men can stand adversity, but if you want to test a man's character, give him power."
    -Abraham Lincoln

  5. #5
    Moderator VBAX Master georgiboy's Avatar
    Joined
    Mar 2008
    Location
    Kent, England
    Posts
    1,199
    Location
    Lucas i did not know there was so much (hate) for a strong word for the calendar control. I do like the file you have provided, it must have taken alot of refining to get it working that well. I have some files that may have a strong use for this.
    Click here for a guide on how to add code tags
    Click here for a guide on how to mark a thread as solved
    Click here for a guide on how to upload a file with your post

    Excel 365, Version 2403, Build 17425.20146

  6. #6
    Moderator VBAX Wizard lucas's Avatar
    Joined
    Jun 2004
    Location
    Tulsa, Oklahoma
    Posts
    7,323
    Location
    Quote Originally Posted by georgiboy
    Lucas i did not know there was so much (hate) for a strong word for the calendar control. I do like the file you have provided, it must have taken alot of refining to get it working that well. I have some files that may have a strong use for this.
    Hate is such a strong word......frustration after working and incorporating calendar controls just to find it doesn't work when you distribute it can get you pretty upset though.

    Glad to share. I think a similar version is in the kb.
    Steve
    "Nearly all men can stand adversity, but if you want to test a man's character, give him power."
    -Abraham Lincoln

  7. #7
    Georgiboy, I like your solution a lot. One issue I've noticed is that each time I click on the calendar button, it adds all of the names to the list again. I think replacing "UserForm_Activate()" with "UserForm_Initialize()" fixes this, though.

Posting Permissions

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