Need help with creating a macro to close popup calendar (Excel 2007)

gmaboing

New Member
Joined
Mar 24, 2010
Messages
33
Hello all,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:eek:ffice:eek:ffice" /><o:p></o:p>
<o:p></o:p>
BASIC HISTORY OF WHAT I'M DOING<o:p></o:p>
I have a popup calendar that appears when a user selects/activates a specific cell (e.g. B6) by single mouse click or by navigating to the cell by using the arrow keys. When the cell is selected/activated, the calendar appears with the current day already highlighted and the user can then click on whatever day they want and after they click on the day they want, the calendar closes.<o:p></o:p>
<o:p></o:p>
<o:p></o:p>
PROBLEM<o:p></o:p>
While creating a new macro that will clear specified populated cells, I selected cell B6 to remove the date that is in cell B6 and the calendar popped up. I closed the calendar by clicking the close button ("x") and then deleted the date out of cell B6. After I finished all of my steps, I checked the macro and everything recorded except when I closed the popup calendar. <o:p></o:p>
<o:p></o:p>
Does anyone have any idea of how I can include code in my macro that will close the popup calendar when it appears? :confused:<o:p></o:p>
<o:p></o:p>
<o:p></o:p>
I tried using the 'SendKeys' statement for Alt+F4, but this did not work. <o:p></o:p>
<o:p></o:p>
Thank you to everyone in advance.
 

Some videos you may like

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.

Andrew Poulsom

MrExcel MVP
Joined
Jul 21, 2002
Messages
73,092
Assuming you are using the Worksheet_SelectionChange event procedure to pop up the calendar, at the beginning of your new macro put:

Application.EnableEvents = False

and:

Application.EnableEvents = True

at the end. Then the event procedure won't fire.
 

gmaboing

New Member
Joined
Mar 24, 2010
Messages
33
Assuming you are using the Worksheet_SelectionChange event procedure to pop up the calendar, at the beginning of your new macro put:

Application.EnableEvents = False

and:

Application.EnableEvents = True

at the end. Then the event procedure won't fire.


ANDREW... YOU ARE THE MAN!!!!! THIS IS EXACTLY WHAT I NEEDED! I have been scratching my head for weeks on this (mainly because I'm stuborn and have to try and figure it out by myself before I ask for help.)

If you were in Orlando, I would bake you one of my famous homemade pound cakes!

I (and my bald spot) thank you! :biggrin:
 

Watch MrExcel Video

Forum statistics

Threads
1,118,662
Messages
5,573,480
Members
412,533
Latest member
Pejter
Top