Results 1 to 4 of 4
  1. #1
    2 Star Lounger
    Join Date
    Apr 2003
    Location
    England
    Posts
    124
    Thanks
    0
    Thanked 0 Times in 0 Posts

    adding a date to a user form (office 2000)

    how can i add a date to a user form each time it is use. so that it will show in an excel worksheet

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: adding a date to a user form (office 2000)

    What do you mean by "add a date to a userform"?

    You can use the UserForm_Initialize event to set the text of a text box to the current date. If the text box is linked to a worksheet cell by its Control Source property, the cell will be updated automatically:

    Private Sub UserForm_Initialize()
    Me.TextBox1.Text = Date
    End Sub

    (Replace TextBox1 by the name of your text box)

    If this is not what you meant, please explain in more detail.

  3. #3
    2 Star Lounger
    Join Date
    Apr 2003
    Location
    England
    Posts
    124
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: adding a date to a user form (office 2000)

    thank you for such a speedy reply. what i am trying to say is that each time the form is used the date is placed in cell "J12" automatically without keying in anything.

  4. #4
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Dublin, Ireland, Republic of
    Posts
    2,697
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: adding a date to a user form (office 2000)

    You could Change Hans's ,code to read

    Private Sub UserForm_Initialize()
    Range("J12") = Date
    End Sub

    This will enter the date in J12 of the active sheet.

    Andrew C

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •