Results 1 to 9 of 9

Calendar with restricted dates to select

Threaded View

bjohnsonac Calendar with restricted... 03-18-2009, 12:46 PM
MickG Re: Calendar with restricted... 03-18-2009, 01:19 PM
bjohnsonac Re: Calendar with restricted... 03-18-2009, 02:58 PM
MickG Re: Calendar with restricted... 03-19-2009, 05:46 AM
bjohnsonac Re: Calendar with restricted... 03-20-2009, 09:53 AM
MickG Re: Calendar with restricted... 03-20-2009, 10:28 AM
bjohnsonac Re: Calendar with restricted... 03-20-2009, 10:36 AM
  1. #2
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650

    Re: Calendar with restricted dates to select

    Hi, On your Toolbar Select, "View","Toolbars", "Control ToolBox", at the bottom of the menu , there is an icon (Looks like Hammer & Spanner) Icon Says "More Controls", Click this and Select Calendar from the list, Click sheet, Calendar Appears on sheet.

    Right click youy sheet, Select "View Code", VB Window appears.
    Paste Both the codes (in one) into the Window.
    Close Window
    When you click in sheet the Calendar should disappear and when you click cell "A1" it reappears.
    The calendar Code tells you, when you click a Weekday or the Weekend.
    You need to alter it to do what you want.
    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    If Target.Address = "$A$1" Then
        Calendar1.Visible = True
    Else
        Calendar1.Visible = False
    End If
    End Sub
    Private Sub Calendar1_Click()
    If Not Weekday(Calendar1.Value) = 1 Xor Not _
        Weekday(Calendar1.Value) = 7 Then
        MsgBox "Do something"
    Else
        MsgBox "You Selected a Week Day"
    Exit Sub
    End If
    End Sub
    Regards Mick
    Last edited by MickG; 03-18-2009 at 01:22 PM.

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