+ Reply to Thread
Results 1 to 10 of 10

Calender Code

Hybrid View

Mamud Calender Code 10-01-2011, 08:03 PM
royUK Re: Calender Code 10-02-2011, 03:08 AM
Mamud Re: Calender Code 10-02-2011, 04:07 AM
royUK Re: Calender Code 10-02-2011, 04:33 AM
Mamud Re: Calender Code 10-02-2011, 06:20 AM
royUK Re: Calender Code 10-02-2011, 07:31 AM
Mamud Re: Calender Code 10-02-2011, 08:08 AM
royUK Re: Calender Code 10-02-2011, 08:18 AM
Mamud Re: Calender Code 10-02-2011, 08:27 AM
Mamud Re: Calender Code 10-02-2011, 08:49 AM
  1. #1
    Forum Contributor
    Join Date
    09-01-2011
    Location
    England
    MS-Off Ver
    Excel 365
    Posts
    126

    Calender Code

    HELLO GUYS;

    I have that calender user form


    Private Sub Calendar2_Click()
    RawLog.TextBox7.Value = Calendar2.Value
    Unload Me
    End Sub
    
    Private Sub UserForm_Activate()
        Me.Calendar2.Value = Date
    End Sub
    That calender code is used for (Rawlog.textbox7)
    How can I use that code to another textbox in the same user form ??
    and how can I use that calender form for another textboxes in another user form ??

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

    Re: Calender Code

    Which calendar form do you mean? Maybe 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

  3. #3
    Forum Contributor
    Join Date
    09-01-2011
    Location
    England
    MS-Off Ver
    Excel 365
    Posts
    126

    Re: Calender Code

    here's an example

    I want to make all textboxes open the same calender and take different values from that calender
    Attached Files Attached Files

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

    Re: Calender Code

    Use the Enter event of each TextBox like this
    Private Sub TextBox8_Enter()
    Cal01.Show
    End Sub
    Change the calendar Click event to
    Private Sub Calendar1_Click()
    RawLog.ActiveControl = Me.Calendar1.Value
    Unload Me
    End Sub

  5. #5
    Forum Contributor
    Join Date
    09-01-2011
    Location
    England
    MS-Off Ver
    Excel 365
    Posts
    126

    Re: Calender Code

    Nice royUK, it works

    but what can I do, If I have 2 different userforms ??

  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: Calender Code

    To use it on multiple forms see the example. You might have to add the Calendar form again because it's not installed on my PC
    Attached Files Attached Files

  7. #7
    Forum Contributor
    Join Date
    09-01-2011
    Location
    England
    MS-Off Ver
    Excel 365
    Posts
    126

    Re: Calender Code

    I got a msg in frm

    Variable not defined

  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: Calender Code

    The code works for me.

    Have you added anything? The message indicates that a variable has been added without declaring it

  9. #9
    Forum Contributor
    Join Date
    09-01-2011
    Location
    England
    MS-Off Ver
    Excel 365
    Posts
    126

    Re: Calender Code

    can you add me the code to enter the calender value to the textboxes??

  10. #10
    Forum Contributor
    Join Date
    09-01-2011
    Location
    England
    MS-Off Ver
    Excel 365
    Posts
    126

    Re: Calender Code

    Mr. royUK
    I cant add a value from the calender in ur last attached file...

+ 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