+ Reply to Thread
Results 1 to 3 of 3

Assign dynamic value to checkboxes

  1. #1
    Registered User
    Join Date
    07-14-2015
    Location
    India
    MS-Off Ver
    3
    Posts
    24

    Assign dynamic value to checkboxes

    Hi,

    I have a multipage form. In page1 there are 5 checkboxes. Each checkboxes are dynamically created with the reference to excel row.

    In my excel file, there is a data with column heading and row heading. I selected row heading as checkbox in my form and this checkboxes are dynamically created with the following code :

    Const Vis_Strt As Integer = 5
    Const Vis_End As Integer = 9
    Dim Vis_Top As Integer
    Dim iRow As Integer

    For iRow = Vis_Strt To Vis_End
    If wks.Cells(iRow, col_num) <> "-" Then
    Set ctlCheckBox = Me.MultiPage1.Pages(0).Controls.Add("Forms.Checkbox.1")

    With ctlCheckBox
    .Caption = Cells(iRow, "A")
    .Name = "cb" & iRow
    .Left = FORM_LEFT
    .Top = Vis_Top
    .Width = iWidth
    End With
    Vis_Top = Vis_Top + iPITCH
    End If
    Next iRow



    In my excel file. Each row heading have a value associated with it. The value of checkboxes will change as per the column heading.I want to assign this value to the checkboxes and in the end I want to add only the CHECKED checkbox value.

    For better understanding I have attached the excel file. You can also see the vb form that I already created.

    Please help me out in this.

    Thanks.
    Attached Files Attached Files

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Assign dynamic value to checkboxes

    Why not use a multiselect listbox?
    If posting code please use code tags, see here.

  3. #3
    Registered User
    Join Date
    07-14-2015
    Location
    India
    MS-Off Ver
    3
    Posts
    24

    Re: Assign dynamic value to checkboxes

    How can I use it, Can you please explain?

    I am new to VBA.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. read out of dynamic amount of checkboxes
    By nasdrasil in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-24-2014, 03:49 PM
  2. Assign number to combination of checkboxes
    By laguna92651 in forum Excel General
    Replies: 3
    Last Post: 11-11-2014, 01:20 AM
  3. [SOLVED] Please help! macro code needed to assign to command button to check a column of checkboxes
    By cnbv in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-22-2013, 04:47 AM
  4. [SOLVED] Dynamic Number of Checkboxes
    By Bob1980 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-12-2013, 01:07 PM
  5. Creating Dynamic Checkboxes
    By moosenator in forum Excel General
    Replies: 1
    Last Post: 10-02-2012, 09:32 PM
  6. Assign Macro(s) to multiple checkboxes
    By realdealsxbl in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-14-2012, 09:14 PM
  7. How do I assign macro codes to multiple checkboxes
    By spamunch in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-14-2011, 11:05 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