+ Reply to Thread
Results 1 to 14 of 14

LDDate on Userform

  1. #1
    Forum Contributor
    Join Date
    07-22-2012
    Location
    Spain
    MS-Off Ver
    Excel 2008
    Posts
    304

    LDDate on Userform

    Hello!

    Does someone knows how can I link a cell in my workbook to a "LDDate" in my userform? What I'm really looking to is to each time I open the userform, look in the range B1:B500 for the maximum value and display it on the LDDate box I have on my userform.

    Before I was using this with the following macro but this only works for a textbox...

    Please Login or Register  to view this content.
    Thanks!

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: LDDate on Userform

    Hi,

    What sort of object is your 'LDDate' in the user form. A ComboBox, ListBox or what. Whatever it is just change the reference to 'TextBox1' to whatever.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Forum Contributor
    Join Date
    07-22-2012
    Location
    Spain
    MS-Off Ver
    Excel 2008
    Posts
    304

    Re: LDDate on Userform

    It's a date format in which you select from a small calendar the day you want to input. I tried changing the reference of Textbox but maybe Im not putting the correct name...

  4. #4
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: LDDate on Userform

    Hi,

    But what's the object? If it's the old msCal (Calendar) object then use the objects name - presumably 'Calendar1' instead of 'Textbox1'.

    And If it is the old msCal calendar object are you sure the maximum cell in B1:B500 is a valid date that the calendar can recognise?

  5. #5
    Forum Contributor
    Join Date
    07-22-2012
    Location
    Spain
    MS-Off Ver
    Excel 2008
    Posts
    304

    Re: LDDate on Userform

    Hi,

    I dont really know if its the old calendar or not but I'm now wondery if maybe the main proble is that the calendar doesnt recognise the format of the cells in range B1:B500

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

    Re: LDDate on Userform

    Attach an example workbook
    Hope that helps.

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

    Free DataBaseForm example

  7. #7
    Forum Contributor
    Join Date
    07-22-2012
    Location
    Spain
    MS-Off Ver
    Excel 2008
    Posts
    304

    Re: LDDate on Userform

    Hello and thanks for your interest!

    I have attached the Excel book in which Im working on. The idea is that when executing the macro (the command buton on the top left hand side "Run") on the first UserForm that pops up the date and time that appears displays the maximum value from range I13:I1012 and J13:J1012 respectively.

    Hope you can help me!!

    Thanks!!
    Attached Files Attached Files

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

    Re: LDDate on Userform

    You have used ActiveX Calendar controls. These are problematic becaause they are not available to all users, I am using Excel 2010 which no longer supports them

  9. #9
    Forum Contributor
    Join Date
    07-22-2012
    Location
    Spain
    MS-Off Ver
    Excel 2008
    Posts
    304

    Re: LDDate on Userform

    Ok thats good to know cause It opens a message alert each time I try to run the userform... Is there any other I can use instead and I will change it better...

    Thanks!

  10. #10
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: LDDate on Userform

    What exactly do you want to do with the maximum date when you get it.
    Is it just for information on the UserForm, in which case you could simply populate a label or textbox control with the date. Or do you want the user to be able to change the date and then do something with it?

  11. #11
    Forum Contributor
    Join Date
    07-22-2012
    Location
    Spain
    MS-Off Ver
    Excel 2008
    Posts
    304

    Re: LDDate on Userform

    Well theorically its just for information only but I would like to leave it open so that the user can modify if necesary

    Thanks

  12. #12
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: LDDate on Userform

    Hi,

    I don't understand. Those two choices are mutually exclusive. It can't be both 'for information only' and for 'modification if necessary'.

    If you want to be able to modify it and use the date in your macros then you can either
    1. Read it into a ComboBox which the user may or may not change.
    2. Open an InputBox which shows the user the date and prompts the user to change if necessary
    3. Read it into say a label or TextBox and provide say three list boxes from which the user can choose a day, month and year, (in a similar way to what you see on web forms which ask for say DOB)

    1 & 2 are similar and you'll need to write some additional code to validate what the user enters to ensure it's a proper date that a macro could use.
    3 is simpler since it forces the user to use only valid numbers from which a Date Serial number can be constructed.

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

    Re: LDDate on Userform

    Use one of my solutions here at the bottom of the datePicker section.

  14. #14
    Forum Contributor
    Join Date
    07-22-2012
    Location
    Spain
    MS-Off Ver
    Excel 2008
    Posts
    304

    Re: LDDate on Userform

    Hello and thanks for the help!!

    I found on the web an excel sheet where there is a "date input" field really nice and that I think can be usefull. When clicking the field it pops up a calendar where you can choose the date.

    You will find it doing:

    - Open workbook
    - Run the macro on the doing click on "RUN" botton.
    - On the userform click the field that says "6-FECHA INGRESO:"

    The only thing I cannot manage to do is to take that calendar to my own excel. Its strange cause when opening the userform in the VBA I cannot see that field!!

    Hope you can help me!

    Thanks!
    Attached Files Attached Files

+ 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