Consulting

Results 1 to 6 of 6

Thread: Activating a pop up calendar by clicking in a cell

  1. #1
    VBAX Regular
    Joined
    Sep 2004
    Posts
    26
    Location

    Activating a pop up calendar by clicking in a cell

    Hi,

    Don't know if any one can help me.....

    I've just added a pop up calendar to a Excel spreadsheet which works fine and pops up when clicking on a button.... But is there any way I can not rely on a button to make the calendar pop but instead make it pop up when I click in to a cell (P6)...?

    Thanks.....

  2. #2
    VBAX Master Killian's Avatar
    Joined
    Nov 2004
    Location
    London
    Posts
    1,132
    Location
    This is the kind of thing you can add to your right-click menu by using the Worksheet_BeforeRightClick event to add a menu item to CommandBars("cell")
    There's a similar thread here with some code that should get you started.
    K :-)

  3. #3
    VBAX Regular
    Joined
    Sep 2004
    Posts
    26
    Location
    Thanks mate....


    I'm sure this will help

  4. #4
    Moderator VBAX Wizard lucas's Avatar
    Joined
    Jun 2004
    Location
    Tulsa, Oklahoma
    Posts
    7,323
    Location

    click cell to run macro

    Darryl,
    I use this to pop up a calendar. Format the cells according to the script that you want to click on to open the calendar.


    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    If Target.NumberFormat = "m/d/yy;@" Then
    If CalendarFrm.HelpLabel.Caption <> "" Then 
    CalendarFrm.Height = 191 + CalendarFrm.HelpLabel.Height 
    Else 
    CalendarFrm.Height = 191
    CalendarFrm.Show
    End If
    End Sub
    you will have to adapt it to your script but it shows how you can format specific cells so that when they are clicked, it will call your form. Hope this helps. It is a custom format. m/d/yy;@

    ps. the vba goes in the code for the sheet
    Steve
    "Nearly all men can stand adversity, but if you want to test a man's character, give him power."
    -Abraham Lincoln

  5. #5
    VBAX Regular
    Joined
    Sep 2004
    Posts
    26
    Location

    Thanks

    Runs perfect

  6. #6
    Moderator VBAX Wizard lucas's Avatar
    Joined
    Jun 2004
    Location
    Tulsa, Oklahoma
    Posts
    7,323
    Location

    calendar

    Darryl,
    Your welcome. I use a userform for the calendar because it travels with the excel book. I tried the calendar controls in Excel but everyone doesn't have the same version of excel and I ran in to problems on other computers. PM me if you would like to see the userform.
    Steve
    "Nearly all men can stand adversity, but if you want to test a man's character, give him power."
    -Abraham Lincoln

Posting Permissions

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