Results 1 to 10 of 10

Creating a User Form with variable number of Controls buttons

Threaded View

  1. #3
    Registered User
    Join Date
    04-24-2008
    Location
    Zurich
    Posts
    45
    You may create a userform with lets say 10 checkboxes and assign the code below to the userform. You have to verify the item indices of the checkboxes (under properties listed as TabIndex). The code as it is assumes index 0 to 9 for the 10 checkboxes.

    Private Sub UserForm_Initialize()
    
    Dim i As Long
    
    For i = 1 To 10
    If Cells(i, 1) = "" Then
        UserForm1.Controls.Item(i - 1).Visible = False
    Else
        UserForm1.Controls.Item(i - 1).Visible = True
        UserForm1.Controls.Item(i - 1).Caption = Cells(i, 1).Value
    End If
    Next
    End Sub
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. VLOOKUP Funtion within a User Form
    By bern in forum Excel General
    Replies: 4
    Last Post: 01-06-2016, 06:11 AM
  2. User form problems
    By lapot in forum Excel General
    Replies: 4
    Last Post: 12-15-2006, 02:02 PM
  3. replacing values in a variable number of columns
    By mwc0914 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-07-2006, 10:42 PM
  4. possible to delay comments until user form receives input?
    By noisepoet in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-28-2006, 01:47 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