title: Detecting changes to checkboxes via VBA
body: <p>Following on from my previous question.</p>
  
  <p>A requirement from the customer is to have checkboxes on a report to disable rows of information on another sheet. The rows are defined as named ranges, formated by P_XXXXXX. The XXXXXX is a unique identifier that is also a field on the row so I can easily generate the range names on the fly.</p>
  
  <p>The problem I am having is:</p>
  
  <ul>
  <li>After clicking on the items and then closing the form Excel asks if we want to save. This is undersirable.</li>
  </ul>
  
  <p>I need someway of registering a change event happening on my generated checkboxes. So if one or more changes I can run through and hide/unhide the relevant ranges.</p>
  
  <p>My code for adding the checkboxes looks like:</p>
  
  <pre><code>        ' For each row...
  
          ' check box in column 17(=Q).
          Dim lCenter As Long
          lCenter = rngCurrent.Width / 4 ' not actual centre but close enough
          With ActiveSheet.CheckBoxes.Add(rngCurrent.Left + lCenter, rngCurrent.Top - 2, rngCurrent.Width, rngCurrent.Height)
              .Interior.ColorIndex = xlNone
              .Caption = ""
          End With
  </code></pre>
  
  <p><strong>So how do you link a change in a checkbox with a sub/function?</strong></p>