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.
 

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:
 

Forum statistics

Threads
1,081,798
Messages
5,361,366
Members
400,628
Latest member
teresajm

Some videos you may like

This Week's Hot Topics

  • populate from drop list with multiple tables
    Hi All, i have a drop list that displays data, what i want is when i select one of those from the list to populate text from different tables on...
  • Find list of words from sheet2 in sheet1 before a comma and extract text vba
    Hi Friends, Trying to find the solution on my task. But did not find suitable one to the need. Here is my query and sample file with details...
  • Dynamic Formula entry - VBA code sought
    Hello, really hope one of you experts can help with this - i've spent hours on this and getting no-where. .I have a set of data (more rows than...
  • Listbox Header
    Have a named range called "AccidentsHeader" Within my code I have: [CODE]Private Sub CommandButton1_Click() ListBox1.RowSource =...
  • Complex Heat Map using conditional formatting
    Good day excel world. I have a concern. Below link have a list of countries that carries each country unique data. [URL...
  • Conditional formatting
    Hi good morning, hope you can help me please, I have cells P4:P54 and if this cell is equal to 1 then i want row O to say "Fully Utilised" and to...
Top