+ Reply to Thread
Results 1 to 4 of 4

VBA Automatically Adding a Checkbox to List

  1. #1
    Registered User
    Join Date
    11-04-2015
    Location
    London, england
    MS-Off Ver
    2007
    Posts
    60

    VBA Automatically Adding a Checkbox to List

    Hi, Can someone please help, i have the below command but i can not get it to add a check box every time i add to the list ...

    Private Sub CommandButton1_Click()
    Set ws = Worksheets("Sheet10")
    lastrow = ws.Range("A" & Rows.Count).End(xlUp).Row + 1
    ws.Range("A" & lastrow).Offset(0, 1).Value = With ActiveSheet.CheckBoxes.Add(Selection.Left, Selection.Top, Selection.Width, Selection.Height)

    End Sub


    Also when the checkbox is ticked it should highlight the row in different color.
    Last edited by shelim481; 08-20-2018 at 07:47 AM.

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,524

    Re: VBA Automatically Adding a Checkbox to List

    This goes in a regular module, it will determine what range the checkbox is that you just clicked.
    You will have to play around with the colors...
    Please Login or Register  to view this content.
    This will go into the worksheet module,
    It will add a checkbox into column B and create a linked cell to column Z, and assign the macro to the checkbox.

    Please Login or Register  to view this content.

  3. #3
    Forum Expert nigelog's Avatar
    Join Date
    12-14-2007
    Location
    Cork, Ireland
    MS-Off Ver
    Office 365 Windows 10
    Posts
    2,293

    Re: VBA Automatically Adding a Checkbox to List

    Please Login or Register  to view this content.
    Last edited by nigelog; 08-20-2018 at 10:33 AM.

  4. #4
    Registered User
    Join Date
    11-04-2015
    Location
    London, england
    MS-Off Ver
    2007
    Posts
    60

    Re: VBA Automatically Adding a Checkbox to List

    Thank YOU All

+ 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. Checkbox is true automatically
    By Sanjibghosh in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-31-2018, 10:12 AM
  2. Automatically adding names to list
    By HarleyRider in forum Excel General
    Replies: 7
    Last Post: 01-01-2018, 11:24 PM
  3. Automatically insert checkbox?
    By excelforbeginners in forum Excel General
    Replies: 0
    Last Post: 01-04-2012, 02:27 PM
  4. Deselecting A CheckBox Automatically
    By heliskier89 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 06-17-2011, 02:22 PM
  5. Excel 2008 : Adding a list of numbers automatically
    By MaximusPrimal in forum Excel General
    Replies: 0
    Last Post: 03-07-2011, 02:40 AM
  6. Automatically adding a row to a list
    By mayerc in forum Excel General
    Replies: 1
    Last Post: 07-10-2006, 04:35 PM
  7. [SOLVED] Need checkbox automatically in some cells of a new row
    By stuff8458 in forum Excel General
    Replies: 0
    Last Post: 11-08-2005, 05:10 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