+ Reply to Thread
Results 1 to 3 of 3

Userform Textbox to activate checkbox when at bottom.

Hybrid View

  1. #1
    Registered User
    Join Date
    01-05-2013
    Location
    Danville, OH
    MS-Off Ver
    Excel 2003 and 2007
    Posts
    7

    Userform Textbox to activate checkbox when at bottom.

    I have been trying to activate a checkbox allowing access to the additional disabled pages on a UserForm AFTER the user reads the scrolled contents in a TextBox. I can lay a scrollbar beside it and controll the scrollbar .min .max. Is there a way to link this with the TextBox LineCount or scroll of the Textbox?

    Anyones help on this would be appreciated. I have searched many posts but none that will activate another after scrolling to bottom of a TexBbox.

    John
    Last edited by ourgarden; 01-05-2013 at 04:24 PM.

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,466

    Re: Userform Textbox to activate checkbox when at bottom.

    Something like this.

    Private m_blnUpdating As Boolean
    Private Sub ScrollBar1_Change()
    
        If Not m_blnUpdating Then
            TextBox1.SetFocus
            TextBox1.CurLine = ScrollBar1.Value - 1
            ScrollBar1.SetFocus
            Label1.Caption = ScrollBar1.Value
            
            If ScrollBar1.Value = ScrollBar1.Max Then CheckBox1.Enabled = True
        End If
        
    End Sub
    
    Private Sub UserForm_Initialize()
    
        m_blnUpdating = True
        TextBox1.SetFocus
        ScrollBar1.Min = 1
        ScrollBar1.Max = TextBox1.LineCount
        m_blnUpdating = False
        
    End Sub
    Attached Files Attached Files
    Cheers
    Andy
    www.andypope.info

  3. #3
    Registered User
    Join Date
    01-05-2013
    Location
    Danville, OH
    MS-Off Ver
    Excel 2003 and 2007
    Posts
    7

    Re: Userform Textbox to activate checkbox when at bottom.

    Andy, that was great!


    Thankyou for your assistance in this endeavor, I new it was simple I just could not 'Focus'!


    John
    Last edited by ourgarden; 01-06-2013 at 10:21 PM.

+ 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