+ Reply to Thread
Results 1 to 10 of 10

How do I implement a frmCalendar?

  1. #1
    Registered User
    Join Date
    03-26-2007
    Posts
    92

    How do I implement a frmCalendar?

    Hello -

    I found this link while looking for help on how to implement a frmCalendar: http://www.fontstuff.com/vba/vbatut07.htm.

    I'd like to know how to adjust this to make a calendar pop up when clicking on only cell A2. I'd like a user to double-click a date, have that date entered into A2 as "mm/dd/yy", and then have the calendar close.

    Any help would be greatly appreciated!

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Assuming you have your calendar form in the workbook and it is called frmCalendar then use the worksheet_change event

    Please Login or Register  to view this content.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Registered User
    Join Date
    03-26-2007
    Posts
    92

    Can't get it to work ...

    Thank you for the quick response!

    Ok, I took the example from that website and put it into an Excel workbook. I've attached the workbook so you can see what I did. However, I'm not sure how to add your code to the workbook to get it to work correctly.
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    03-26-2007
    Posts
    92

    Implementing frmCalendar

    Bumping post

  5. #5
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Right click the sheet tab you wish the calendar to run then select view code and paste in Roy code

    When A2 is changed it calls the calendar

    http://www.cpearson.com/excel/Events.aspx

    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  6. #6
    Registered User
    Join Date
    03-26-2007
    Posts
    92

    It works!

    Thank you both!

    I ended up using this code:
    Please Login or Register  to view this content.
    I found this in another post: http://www.excelforum.com/showthread...ht=frmCalendar

  7. #7
    Registered User
    Join Date
    03-26-2007
    Posts
    92
    One more thing.

    I have to merge cells A2 and B2 for the answer field. By using the code I posted just above, I cannot get the calendar to come up when I click on the merged area. If I unmerge and click on A2, it works fine. Any suggestions as to how I should fix this?

  8. #8
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Maybe

    Please Login or Register  to view this content.
    VBA Noob

  9. #9
    Registered User
    Join Date
    03-26-2007
    Posts
    92
    I got it to work by changing Target.Cells.Count=1 to Target.Cells.Count=2.

    Thank you!

  10. #10
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Quote Originally Posted by penny
    One more thing.

    I have to merge cells A2 and B2 for the answer field. By using the code I posted just above, I cannot get the calendar to come up when I click on the merged area. If I unmerge and click on A2, it works fine. Any suggestions as to how I should fix this?
    Never use Merged cells, you will always find problems with doing so. Consider Center across selection from the Format Menu

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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