Results 1 to 3 of 3

Creating dynamic userform rely on dynamic checkbox selection

Threaded View

END93 Creating dynamic userform... 03-17-2016, 06:09 PM
alansidman Re: I will vomit because of... 03-17-2016, 06:17 PM
END93 Thanks for your information... 03-17-2016, 06:39 PM
  1. #1
    Registered User
    Join Date
    03-15-2016
    Location
    Turkey
    MS-Off Ver
    2013
    Posts
    10

    Creating dynamic userform rely on dynamic checkbox selection

    Dear Guys,

    I need your helps. First of all, I created checkbox dynamic in orange code.

    Public Sub UserForm_Initialize()
    
        Application.Workbooks("17.03 gecesi").Worksheets("Sayfa1").Activate
        
        Dim sutunsayisi As Integer
        
        sutunsayisi = Range("A1", Range("A1").End(xlToRight)).Count
        
        Range("A1").Select
        
        Dim Cb As Variant
        Dim x As Integer
        Dim tp As Integer
        
        tp = 20
        
        For x = 1 To sutunsayisi
            Set Cb = UserForm1.Controls.Add("Forms.CheckBox.1", "CheckBox" & "x", True)
            MsgBox Cb
    '        Cb.Name = "cb" & x
            Cb.Caption = Sayfa1.Cells(1, x).Value
            Cb.Width = 100
            Cb.Height = 20
                If x Mod 2 = 0 Then
                    Cb.Top = tp + 10
                    tp = tp + 30
                    Cb.Left = 130
                Else
                    Cb.Top = tp + 10
                    Cb.Left = 20
                End If
            'ActiveCell.Offset(0, 1).Select
          
        Next x


    Then I create a dynamic commanbutton which name is next in blue code.

    'Dim Com As Control
     
        Set Com = UserForm1.Controls.Add("Forms.CommandButton.1", "CommandButton")
        Com.Caption = "İleri"
        Com.Width = 72
        Com.Height = 24
        Com.Top = tp + 10
        Com.Left = 135
    End Sub

    Now I want to create a new userform rely on the codes that I told above. When I click the checkbox 1 and command button, the second userform will be open. If I click the checkbox 1 and 2 and commandbutton then, first userform 2 will be open and then userform 3 will be open. I started below but It is not working.

    Private Sub Com_Click()
    If UserForm1.Controls.CheckBox1.Value = True Then
    
    UserForm2.Show
    Else
    UserForm3.Show
    End If
    
    End Sub
    This emergency, pleeeeaseeee help meeeee rapidly !!!!!!!!!!!!!!!!!
    Last edited by END93; 03-17-2016 at 06:38 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 1
    Last Post: 12-10-2013, 12:28 AM
  2. Replies: 0
    Last Post: 10-09-2013, 07:59 PM
  3. Excel 2007 : Please help meee
    By sunny002 in forum Excel General
    Replies: 1
    Last Post: 04-09-2012, 07:57 AM
  4. HELP ME PLEASEEE- how to format data in a column
    By Riza in forum Excel General
    Replies: 8
    Last Post: 02-07-2006, 04:45 PM
  5. HELP MEEE
    By jeevanrao in forum Excel General
    Replies: 4
    Last Post: 01-31-2006, 01:50 AM
  6. [SOLVED] HELPPPP!!!!!
    By chris in forum Excel General
    Replies: 3
    Last Post: 01-29-2006, 07:30 PM
  7. HELPPPP!!!!!
    By debinnj in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-10-2005, 02:05 PM
  8. Pivot table tutorial..helpppp!
    By Debutante in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-12-2005, 09:06 PM

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