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

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.

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,122,263
Messages
5,595,166
Members
413,973
Latest member
leon1974mk

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top