+ Reply to Thread
Results 1 to 3 of 3

Help With Forms

  1. #1
    Registered User
    Join Date
    02-09-2005
    Posts
    32

    Question Help With Forms

    I have two forms in an excel document, one has a textbox on, the other has a calendar control on it.

    When I click a button on my excel sheet the first form opens, there is a textbox with the text please enter date, and another button named "Calender".

    When you press "Calandar" it opens the calendar form. what I want to happen is when I click on a date in the calender is for that value to then appear in the inputbox on the first form.

    I can get the calendar to put the date in a cell using the following code:

    Private Sub Calendar1_Click()

    Range("A4").Activate
    ActiveCell = Calendar1.Value
    ActiveCell.NumberFormat = "dd/mm/yy"

    End Sub

    But I need it to be in the text box on the first form

    PLEASE HELP!!

    Dave

  2. #2
    Tom Ogilvy
    Guest

    Re: Help With Forms

    Userform1.Textbox1.Value = format( Calendar1.Value,"mm/dd/yyyy")

    Userform1 refers to the first form (substitute the correct name).
    "Userform1" must still be loaded at the time you do this, so if you drop it
    before showing the calendar, then do it with Hide rather than Unload. If it
    is still showing, it should work OK.

    --
    Regards,
    Tom Ogilvy

    "Dave_2k5" <[email protected]> wrote in
    message news:[email protected]...
    >
    > I have two forms in an excel document, one has a textbox on, the other
    > has a calendar control on it.
    >
    > When I click a button on my excel sheet the first form opens, there is
    > a textbox with the text please enter date, and another button named
    > "Calender".
    >
    > When you press "Calandar" it opens the calendar form. what I want to
    > happen is when I click on a date in the calender is for that value to
    > then appear in the inputbox on the first form.
    >
    > I can get the calendar to put the date in a cell using the following
    > code:
    >
    > Private Sub Calendar1_Click()
    >
    > Range("A4").Activate
    > ActiveCell = Calendar1.Value
    > ActiveCell.NumberFormat = "dd/mm/yy"
    >
    > End Sub
    >
    > But I need it to be in the text box on the first form
    >
    > PLEASE HELP!!
    >
    > Dave
    >
    >
    > --
    > Dave_2k5
    > ------------------------------------------------------------------------
    > Dave_2k5's Profile:

    http://www.excelforum.com/member.php...o&userid=19667
    > View this thread: http://www.excelforum.com/showthread...hreadid=394529
    >




  3. #3
    Registered User
    Join Date
    02-09-2005
    Posts
    32

    Question

    EXCELLENT !!

    This works a treat, thanks for your help.

    Cheers,

    Dave

+ 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