+ Reply to Thread
Results 1 to 2 of 2

Excel 2007 : Linking Checkboxes

Hybrid View

  1. #1
    Registered User
    Join Date
    11-23-2011
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    14

    Linking Checkboxes

    Hello guys, I have a small problem with checkboxes. I have checkboxes in E6:K128 and want to link them to different cells each in range R6:X128. I cant link one and then drag because it links all of them to the same cell. How can I link each one to its own cell without formatting each one individually?
    Thanks for the help.

  2. #2
    Registered User
    Join Date
    11-23-2011
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    14

    Re: Linking Checkboxes

    Well, I found a macro that does this for you. The only thing is it makes the checkbox area much too long. How can I make the size smaller?
    Sub AddCheckBoxes()
        On Error Resume Next
        Dim c As Range, myRange As Range
        Set myRange = Selection
        For Each c In myRange.Cells
            ActiveSheet.CheckBoxes.Add(c.Left, c.Top, c.Width, c.Height).Select
                With Selection
                    .LinkedCell = c.Address
                    .Characters.Text = ""
                    .Name = c.Address
                End With
                c.Select
                With Selection
                    .FormatConditions.Delete
                    .FormatConditions.Add Type:=xlExpression, _
                        Formula1:="=" & c.Address & "=TRUE"
                    .FormatConditions(1).Font.ColorIndex = 8 'change for other color when ticked
                    .FormatConditions(1).Interior.ColorIndex = 8 'change for other color when ticked
                    .Font.ColorIndex = 2 'cell background color = White
                End With
            Next
            myRange.Select
    End Sub

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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