+ Reply to Thread
Results 1 to 18 of 18

Appearance of calendar

  1. #1
    Forum Contributor
    Join Date
    05-19-2009
    Location
    Santiago, Chile
    MS-Off Ver
    Excel 2019
    Posts
    212

    Appearance of calendar

    How can I make that when I click on a certain cell that automatically appears the calendar where i than choose a date?

  2. #2
    Forum Expert contaminated's Avatar
    Join Date
    05-07-2009
    Location
    Baku, Azerbaijan
    MS-Off Ver
    Excel 2013
    Posts
    1,430

    Re: Appearance of calendar

    Select any cell within the range A1:E29 and say if you meant calendar like this????

    see file...
    Attached Files Attached Files
    Люди, питающие благие намерения, как раз и становятся чудовищами.

    Regards, ?Born in USSR?
    Vusal M Dadashev

    Baku, Azerbaijan

  3. #3
    Forum Contributor
    Join Date
    05-19-2009
    Location
    Santiago, Chile
    MS-Off Ver
    Excel 2019
    Posts
    212

    Re: Appearance of calendar

    Quote Originally Posted by contaminated View Post
    Select any cell within the range A1:E29 and say if you meant calendar like this????

    see file...
    Yes that is what I want but would be even better withoout the insert button on the calendar. Just when you click on a date than automatically closes the calendar and fill in the date in the cell.

  4. #4
    Forum Expert contaminated's Avatar
    Join Date
    05-07-2009
    Location
    Baku, Azerbaijan
    MS-Off Ver
    Excel 2013
    Posts
    1,430

    Re: Appearance of calendar

    Do you want to pick a date from calendar or just insert today's date on selection change within certain range???

  5. #5
    Forum Contributor
    Join Date
    05-19-2009
    Location
    Santiago, Chile
    MS-Off Ver
    Excel 2019
    Posts
    212

    Re: Appearance of calendar

    Quote Originally Posted by contaminated View Post
    Do you want to pick a date from calendar or just insert today's date on selection change within certain range???
    I want to choose any date from the calendar. The date will always be in the future from today. It is for a form to fill in.

  6. #6
    Forum Expert contaminated's Avatar
    Join Date
    05-07-2009
    Location
    Baku, Azerbaijan
    MS-Off Ver
    Excel 2013
    Posts
    1,430

    Re: Appearance of calendar

    Double Click on a desired date....
    Attached Files Attached Files

  7. #7
    Forum Contributor
    Join Date
    05-19-2009
    Location
    Santiago, Chile
    MS-Off Ver
    Excel 2019
    Posts
    212

    Re: Appearance of calendar

    Quote Originally Posted by contaminated View Post
    Double Click on a desired date....
    That look nice but how do I make this myself now?

  8. #8
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Appearance of calendar

    Try this one

    It will not allow Date entries before todays date. I think you were asking for that.

    This example works on a combimation of data validation and additional control in the UserForms

    To use with your project

    1/. With the attached file Open the VB editor (alt+f11

    2/. In the Project Explorer Pane (Ctrl+R if it is not showing). highlight
    Userform1 (for a form with a CommandButton)
    Userform2 (for a form without a CommandButton)
    Then File > Export File......
    Save to your chosen folder.
    Close the attached file

    You only have to do this once for each UserForm.

    3/. With your file, in the VB Editor
    File > Import File......
    Select your chosen folder. select the saved UserForm1 or 2 as required
    Press Open

    4/. In the Project Explorer Pane
    Double Click the Sheet you want the form to work with.
    In the blank module that appears
    Paste All of this Code
    Please Login or Register  to view this content.
    In the Sub Worksheet_SelectionChange
    Change

    Range("A2:A" & Rows.Count))
    to the Range or Cells you want the calendar to work with

    and

    UserForm1.Show
    to suit the form you have chosen.

    5/. The Data validation is applied with the code and will come into effect if the user changes a cell manually


    Hope this helps

    If you need any further information, please feel free to ask further

    However

    If this takes care of your needs, please click EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED. It helps everybody!
    Also
    If you are satisfied by any members response to your problem please consider using the scales icon top right of thier post to show your appreciation.
    Attached Files Attached Files

  9. #9
    Forum Contributor
    Join Date
    05-19-2009
    Location
    Santiago, Chile
    MS-Off Ver
    Excel 2019
    Posts
    212

    Re: Appearance of calendar

    Quote Originally Posted by Marcol View Post
    Try this one

    It will not allow Date entries before todays date. I think you were asking for that.

    This example works on a combimation of data validation and additional control in the UserForms

    To use with your project

    1/. With the attached file Open the VB editor (alt+f11

    2/. In the Project Explorer Pane (Ctrl+R if it is not showing). highlight
    Userform1 (for a form with a CommandButton)
    Userform2 (for a form without a CommandButton)
    Then File > Export File......
    Save to your chosen folder.
    Close the attached file

    You only have to do this once for each UserForm.

    3/. With your file, in the VB Editor
    File > Import File......
    Select your chosen folder. select the saved UserForm1 or 2 as required
    Press Open

    4/. In the Project Explorer Pane
    Double Click the Sheet you want the form to work with.
    In the blank module that appears
    Paste All of this Code
    Please Login or Register  to view this content.
    In the Sub Worksheet_SelectionChange
    Change

    Range("A2:A" & Rows.Count))
    to the Range or Cells you want the calendar to work with

    and

    UserForm1.Show
    to suit the form you have chosen.

    5/. The Data validation is applied with the code and will come into effect if the user changes a cell manually


    Hope this helps

    If you need any further information, please feel free to ask further

    However

    If this takes care of your needs, please click EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED. It helps everybody!
    Also
    If you are satisfied by any members response to your problem please consider using the scales icon top right of thier post to show your appreciation.
    This is exactly what I was looking for though I still get an error message when I protect the sheet. So when the sheet is unprotected than it works but when I protect the sheet and the cell (where I need the calendar) is unblocked I get error message and in the VBEditor is marked in yellow the following: " .Add Type:=xlValidateDate, AlertStyle:=xlValidAlertStop, _
    Operator:=xlGreater, Formula1:="=NOW()+1""

    Any clever idea?

  10. #10
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Appearance of calendar

    Hi pansovic

    Please don't qoute entire posts in your replies, it is not nescessary and only clutters the BB.
    If you do need to refer to a post only quote the bit that is essential to clarify your reply.

    Try this
    Please Login or Register  to view this content.

    If you are using a password then change the above lines to
    Please Login or Register  to view this content.

    That should do the trick

    Cheers.

  11. #11
    Forum Contributor
    Join Date
    05-19-2009
    Location
    Santiago, Chile
    MS-Off Ver
    Excel 2019
    Posts
    212

    Re: Appearance of calendar

    Now I get error message "Compilation Error - Variable is not defined" Marked in yellow: "Private Sub Worksheet_SelectionChange(ByVal Target As Range)". marked in blue is "UserForm1".

  12. #12
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Appearance of calendar

    You have not copied the userforms to your workbook.

    I have attached an updated file to this post.

    Follow the instructions in Post #8

    Cheers

    P.S.

    If you only use UserForm1 delete this section of code
    Please Login or Register  to view this content.
    Similarly if you decide to use UserForm2 delete this
    Please Login or Register  to view this content.

    That should solve the problem
    Attached Files Attached Files
    Last edited by Marcol; 05-25-2010 at 05:52 AM.

  13. #13
    Forum Contributor
    Join Date
    05-19-2009
    Location
    Santiago, Chile
    MS-Off Ver
    Excel 2019
    Posts
    212

    Re: Appearance of calendar

    The calendar that I want to appears is on Cell C34 and E34. Apparently
    "Set isect = Intersect(Target, Range("$C$34;$E$34" & Rows.Count))"
    is not working

  14. #14
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Appearance of calendar

    If you only want the calendar pop up in cells C34 & E34 then use this line in place of your line
    "Set isect = Intersect(Target, Range("$C$34;$E$34" & Rows.Count))"


    Please Login or Register  to view this content.

  15. #15
    Forum Contributor
    Join Date
    05-19-2009
    Location
    Santiago, Chile
    MS-Off Ver
    Excel 2019
    Posts
    212

    Re: Appearance of calendar

    I want to make this SOLVED but how can I get to my origenal post. I search for the threat, can find it but always arrive on this one and all above there is no EDIT botton. This is not the first time that I have trouble with this. Just don't remember how I done it last time. Would be much better if there is a botton to cleck on the last post.
    When I click on EDIT botton of last post, than Go Advanced there is no Prefix botton
    Last edited by pansovic; 06-02-2010 at 02:44 PM.

  16. #16
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,375

    Re: Appearance of calendar

    marked solved.

  17. #17
    Registered User
    Join Date
    01-10-2007
    Posts
    9

    Re: Appearance of calendar

    Is there any way to run this and it allows you to choose dates both in the future and in the past?

  18. #18
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Appearance of calendar

    Hope that helps.

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

    Free DataBaseForm example

+ 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