Results 1 to 8 of 8

Checkbox - Add chkbox if one does not already exist

Threaded View

pinebush Checkbox - Add chkbox if one... 02-25-2019, 10:03 AM
nigelog Re: Checkbox - Add chkbox if... 02-25-2019, 12:41 PM
pinebush Re: Checkbox - Add chkbox if... 02-25-2019, 12:57 PM
pinebush Re: Checkbox - Add chkbox if... 02-25-2019, 01:02 PM
nigelog Re: Checkbox - Add chkbox if... 02-25-2019, 01:02 PM
nigelog Re: Checkbox - Add chkbox if... 02-25-2019, 01:22 PM
pinebush Re: Checkbox - Add chkbox if... 02-26-2019, 04:57 PM
nigelog Re: Checkbox - Add chkbox if... 02-27-2019, 12:33 PM
  1. #1
    Registered User
    Join Date
    02-10-2011
    Location
    Canada
    MS-Off Ver
    Excel 2019 / MS365
    Posts
    55

    Checkbox - Add chkbox if one does not already exist

    Can someone please help with the required code to add checkboxes to a worksheet, in Column A? I am able to add a checkbox to a cell in Column A, based on a value in column B. I am also able to delete all checkboxes, using code I found on the web. Where I fail is to be able to add a checkbox only if one does not already exist.

    If a user inserts an extra row in the spreadsheet, it will of course not contain a checkbox. I would like my code to conditionally add a checkbox in the corresponding row, IF it does not already contain a checkbox. My code is not allowing me to do so, in spite of all my attempts. I suspect that the problem is in one of the rows shown below, as the code seems to keep looping back to the FIRST checkbox, then comparing its position with the position of the cell in the current looped row. It always compares the first checkbox, so of course, after the first looped row, it will always fail.

    For Each chkbx In ActiveSheet.CheckBoxes     
        'Check if Cell in column B is not equal to nothing
        If Cells(intRow, "B").Value <> "" Then    
          If Intersect(Range(chkbx.TopLeftCell.Address), Cells(intRow, 1)) Is Nothing Then
    'do  your stuff
    These checkboxes are not being used in a form, rather they are placed in worksheet cells. The idea is that any rows (records) which contain a checked checkbox will be copied to another worksheet.

    Thanks in advance for your consideration and help.
    Attached Files Attached Files
    Last edited by pinebush; 02-26-2019 at 04:52 PM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Checkbox - Add chkbox if one does not already exist
    By pinebush in forum Excel General
    Replies: 1
    Last Post: 02-25-2019, 10:31 AM
  2. Issue Populating PDF Checkbox via VBA that didn't Exist on Previous Form
    By MeleaB in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-17-2016, 08:09 PM
  3. ChkBox controlled dropdown
    By Ramachandran in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-17-2011, 10:44 AM
  4. putting a chkbox caption onto a worksheet cell
    By GregJG in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-04-2007, 10:47 AM
  5. How to reference a vba chkbox from a vba command button on excel?
    By Sterl in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-16-2006, 08:40 PM
  6. store chkbox.caption in array
    By ilyaskazi in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-07-2005, 01:05 PM
  7. enable/disable start button on basis of chkbox conditions
    By ilyaskazi in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-04-2005, 04:09 AM

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