+ Reply to Thread
Results 1 to 2 of 2

I want to create checkbox dynamically and assign them a value if checked or unchecked

  1. #1
    Registered User
    Join Date
    07-13-2017
    Location
    Turkey
    MS-Off Ver
    2016
    Posts
    2

    I want to create checkbox dynamically and assign them a value if checked or unchecked

    Sub Macro2()

    Dim sh As Worksheet
    Set sh = ThisWorkbook.Sheets("sheet7")

    sh.Activate
    Dim fieldlookup As Worksheet
    Set fieldlookup = ThisWorkbook.Sheets("Fieldlookup")
    With fieldlookup
    lr = .Cells(Rows.Count, 3).End(xlUp).Row
    End With
    For i = 1 To lr
    sh.CheckBoxes.Add(2, 20 * i, 300, 10).Select
    With Selection
    .Value = xlOff
    .LinkedCell = "$L$i"
    .Display3DShading = False
    .Caption = fieldlookup.Cells(i + 1, 3)
    End With

    Next i
    End Sub
    //When I click one of the checkboxes they are all changing. How can I fix this ? ty,

  2. #2
    Valued Forum Contributor ranman256's Avatar
    Join Date
    07-29-2012
    Location
    Kentucky
    MS-Off Ver
    Excel 2003
    Posts
    1,177

    Re: I want to create checkbox dynamically and assign them a value if checked or unchecked

    Use a cell instead of a checkbox.
    They are easy to put an 'X" in, easy to reference.

+ 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. how to create checked and unchecked checkboxes based on three criterion?
    By pejoi in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-12-2014, 09:37 PM
  2. Replies: 0
    Last Post: 03-10-2014, 10:30 AM
  3. [SOLVED] userform checked and unchecked instances
    By arleutwyler in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-18-2013, 02:20 AM
  4. CheckBox copies data when checked but needs to also remove data when unchecked
    By matrixpom in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 10-29-2012, 03:34 AM
  5. [SOLVED] How do I change a checkbox to unchecked without running the code within the checkbox
    By jsunnb in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-27-2012, 09:28 PM
  6. [SOLVED] ActiveX Checkbox entering a value when checked or unchecked
    By Sky188 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-18-2012, 02:59 PM
  7. calculate checked and unchecked of checkbox
    By laici in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-03-2009, 02:12 PM
  8. [SOLVED] Gridline box checked or unchecked. Gridlines do not print.
    By bobb in forum Excel - New Users/Basics
    Replies: 3
    Last Post: 03-28-2006, 02:00 PM

Tags for this Thread

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