Results 1 to 10 of 10

Control dynamically created Userform controls via class module

Threaded View

nigelog Control dynamically created... 11-16-2018, 10:52 AM
romperstomper Re: Control dynamically... 11-16-2018, 11:08 AM
nigelog Re: Control dynamically... 11-16-2018, 11:34 AM
romperstomper Re: Control dynamically... 11-16-2018, 11:36 AM
nigelog Re: Control dynamically... 11-16-2018, 11:53 AM
Andy Pope Re: Control dynamically... 11-16-2018, 12:32 PM
romperstomper Re: Control dynamically... 11-16-2018, 12:36 PM
nigelog Re: Control dynamically... 11-16-2018, 12:47 PM
romperstomper Re: Control dynamically... 11-16-2018, 12:51 PM
nigelog Re: Control dynamically... 11-16-2018, 01:12 PM
  1. #1
    Forum Expert nigelog's Avatar
    Join Date
    12-14-2007
    Location
    Cork, Ireland
    MS-Off Ver
    Office 365 Windows 10
    Posts
    2,293

    Control dynamically created Userform controls via class module

    Im going to have to ask this question because it will drive me mad for the weekend. I was trying to complete something for a forum member Thread here https://www.excelforum.com/excel-pro...-on-forms.html regarding changes to large numbers of controls.

    I've not much experience with class modules but got this far with code from web (attached workbook)

    This creates a set number of linked controls a checkbox, a textbox and a combobox

    I am trying to use the value of the checkbox to control what of the other two items is visible.

    I can isolate the integer and I know that the controls exist because I can list the exact names but I just cant address them. Tried many variations. The Code would have to be in the class Module. Any help appreciated

    ''''''code with various attempts at addressing controls.
    Private Sub EditCheck_Click()
    Dim myStr As String
    myStr = onlyDigits(EditCheck.Name)
    With EditCheck
        MsgBox EditCheck.Name & " " & "=" & " " & .Value
        UserForm1.txtBox(myStr).Value = "Yeah"
        'UserForm1.cboBox(myStr).Visible = Not .Value
        'UserForm1.Controls.cboBox(myStr).Visible = Not .Value
        'UserForm1.Controls.txtBox(myStr).Visible = .Value
    End With
    End Sub
    Attached Files Attached Files
    Last edited by nigelog; 11-16-2018 at 01:13 PM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Using Class Module for handling events of dynamically created controls
    By jagman in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-17-2018, 01:14 PM
  2. Custom Class Module for multiple UserForm controls?
    By AnthonyGFS in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-25-2018, 03:36 AM
  3. place dynamically created controls in row and column into the userform with in the frame
    By gokulkrishi in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-02-2016, 01:38 AM
  4. [SOLVED] Userform & Dynamic Controls & Class Module
    By sarndt01 in forum Excel Programming / VBA / Macros
    Replies: 21
    Last Post: 09-18-2014, 01:53 PM
  5. [SOLVED] userForm -> Frame 'top' value limited. Dynamically created controls,
    By kropeck in forum Excel Programming / VBA / Macros
    Replies: 29
    Last Post: 08-19-2013, 09:04 AM
  6. Replies: 1
    Last Post: 10-12-2012, 04:36 AM

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