+ Reply to Thread
Results 1 to 7 of 7

Calendar object in cells

  1. #1
    Registered User
    Join Date
    07-03-2014
    Location
    Dublin, Ireland
    MS-Off Ver
    2007
    Posts
    20

    Calendar object in cells

    Hi there. I am trying to use a calendar control in two separate cells.

    I have two cells for a user to enter dates 'Start Date' (Cell F8) and 'End Date (Cell G8) - located on Sheet1 'Search'.
    I want the calendar to pop up when the user select the cell and for it to hide when they enter the date.

    I've managed to get the calendar control to pop up for the 'Start Date' but can't manage to get it to hide once the date is selected.
    I've then run into problems trying to do the same for the 'End Date' as the calendar object won't hide.

    In summary - I just want to try and have a calender control in each of the cells F8 and G8 on Sheet1.

    Any help or guidance would be greatly appreciated.

    many thanks
    Attached Files Attached Files
    Last edited by kingsp; 10-01-2014 at 01:57 PM.

  2. #2
    Forum Expert
    Join Date
    11-26-2013
    Location
    Colac, Victoria, Australia
    MS-Off Ver
    Excel 2016
    Posts
    1,309

    Re: Calendar object in cells

    Hi Kingsp,

    I can't get your workbook to run as all on my system - the forms seem to be missing and the macro can't find Calendar1 etc -, however, can you try adding Unload.Me as the last line in your macro and see how you go.

    I hope this helps, please let me know!

    Regards,

    David

    If this has been of assistance, please advise. A little thanks goes a long way.
    - Please click on the *Add Reputation button at the bottom of helpful responses.

    Please mark your thread as SOLVED:
    - Click Thread Tools above your first post, select "Mark your thread as Solved".

    If several people have responded, when you reply please make it clear WHO you are responding
    to by mentioning their name.

  3. #3
    Registered User
    Join Date
    07-03-2014
    Location
    Dublin, Ireland
    MS-Off Ver
    2007
    Posts
    20

    Re: Calendar object in cells

    Hi David,

    Thanks for your reply. The workbook was created in Excel 2003 (needs upgrading I know) - I just checked it there and it works on my system.

    I managed to get the first calendar working by using
    Please Login or Register  to view this content.
    at the end of the routine.

    I cannot however get the second calendar to work. I copied over the code from Calendar1 and Calander2 just stays static on the worksheet. The code I am using is:

    Please Login or Register  to view this content.

    thanks for your help in the first instance, it put me on the right track.

    Simon.
    Last edited by kingsp; 09-29-2014 at 04:44 AM.

  4. #4
    Forum Expert
    Join Date
    11-26-2013
    Location
    Colac, Victoria, Australia
    MS-Off Ver
    Excel 2016
    Posts
    1,309

    Re: Calendar object in cells

    You're welcome.

    I did try your model in XL2003, but it still didn't work - it must be pointing to something on your machine that I cant see.

    Did you try the Unload.Me? I'm no VBA expert, but it may be that while you can't see it, the object may still be there, and preventing you from using it again.


    Thanks for reply, I'm pleased you're now on your way.

    By the way - thanks for attempting to place the HTML markers around the code - but you got the syntax wrong. The / goes before CODE. I find it easier to click the # icon at the top of your message/reply window.

    I hope this helps, please let me know!

    Regards,

    David

    If this has been of assistance, please advise. A little thanks goes a long way.
    - Please click on the *Add Reputation button at the bottom of helpful responses.

    Please mark your thread as SOLVED:
    - Click Thread Tools above your first post, select "Mark your thread as Solved".

    If several people have responded, when you reply please make it clear WHO you are responding
    to by mentioning their name.

  5. #5
    Registered User
    Join Date
    07-03-2014
    Location
    Dublin, Ireland
    MS-Off Ver
    2007
    Posts
    20

    Re: Calendar object in cells

    Apologies re the code tags - I should have double checked. They are now entered correctly.

    Thanks again David. I used Visible = False at the end of the routine for the first Calendar and it worked. I am still stuck in trying to figure out how to make the second calendar object hide after selecting a date. I've attached another sample (which hopefully works) showing how far I've managed to get.

    many thanks

    Simon
    Attached Files Attached Files

  6. #6
    Forum Expert
    Join Date
    11-26-2013
    Location
    Colac, Victoria, Australia
    MS-Off Ver
    Excel 2016
    Posts
    1,309

    Re: Calendar object in cells

    Hi Simon,

    Sorry for the delay - I was away all day yesterday.

    I have tried your new post. I can open it, and see the Calendar, but the macro doesn't work. I get a Compile error: Can't find project or library message.

    Perhaps your Calendar is in your Personal.xls file or somewhere else - I can't find it!

    Any way, from what I have read - Unload Me should be at the end of your macro. (I note that I inadvertently included a dot in my earlier post.

    HOWEVER, this may not work. I have just discovered this on the web http://www.experts-exchange.com/Soft..._26449160.html

    I haven't followed it through, but it may help.

    I hope this helps, please let me know!

    Regards,

    David

    If this has been of assistance, please advise. A little thanks goes a long way.
    - Please click on the *Add Reputation button at the bottom of helpful responses.

    Please mark your thread as SOLVED:
    - Click Thread Tools above your first post, select "Mark your thread as Solved".

    If several people have responded, when you reply please make it clear WHO you are responding
    to by mentioning their name.
    Last edited by David A Coop; 10-01-2014 at 03:46 AM.

  7. #7
    Registered User
    Join Date
    07-03-2014
    Location
    Dublin, Ireland
    MS-Off Ver
    2007
    Posts
    20

    Re: Calendar object in cells

    I managed to solve the issue with the information here http://www.fontstuff.com/vba/vbatut07_2003.htm.

    It works great!

    Thanks again for your help David - much appreciated.

    best regards

    Simon

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Using one calendar object for mutlipule textboxes
    By LoveCandle in forum Excel Programming / VBA / Macros
    Replies: 24
    Last Post: 12-30-2015, 04:24 AM
  2. [SOLVED] Worksheet object (Calendar)
    By Mike Rogers in forum Excel General
    Replies: 2
    Last Post: 05-19-2006, 11:25 AM
  3. Set a set as Calendar Control Object
    By gabch in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-16-2006, 08:45 AM
  4. use of calendar object?
    By CathyZ in forum Excel General
    Replies: 1
    Last Post: 05-04-2006, 02:15 PM
  5. How to move the calendar object?
    By DORI in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-09-2005, 02:35 PM

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