How can I grey out specific dates in a Calendar Control within a VBA User Form?

Posted on 2008-11-19
Last Modified: 2012-08-14
I've got a user form with a calendar control that comes with Excel (as described in or

Is there someway I can grey out an arbitrary number of dates in the calendar so they are not selectable?
Question by:jnash67
    1 Comment
    LVL 81

    Accepted Solution

    No, that control does not support disabling specific dates and I don't know one that does.

    I believe your best course of action is to use the Click event handler for the control and check the selected date. If not valid then display a message or set the date to the nearest valid date.


    Featured Post

    What Is Threat Intelligence?

    Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

    Join & Write a Comment

    Suggested Solutions

    Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
    Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
    Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
    This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now