title: Select and Edit all buttons in sheet
body: <p>The routine below allows the user to toggle where they have completed/not completed the required entry. The button text changes to Complete/Incomplete and the adjacent cell goes green/red using simple conditional formatting on the 0 or 1 value. Works fine for updating a single line.</p>
  
  <p>The number of data entry rows will vary for each user (say 10 to 100) and I am trying to find a way of selecting and then changing all the buttons in the sheet to "Complete" and updating the adjacent cell to 0 or 1 in one go, should the user want to do that.</p>
  
  <p>Each row is a data entry line and each cell in Column B has a button, and a 0/1 in adjacent cell in Column C.</p>
  
  <pre><code>Sub complete()
  'Complete / Incomplete Buttton and Flag
  
  Dim buttontext As String
  
  buttontext = Application.Caller
  ActiveSheet.Buttons(Application.Caller).TopLeftCell.Select
  ActiveCell.Select
  
  If ActiveSheet.Buttons(buttontext).Caption = "Mark as Incomplete" Then
      ActiveSheet.Buttons(buttontext).Caption = "Mark as Complete"
      ActiveCell.Offset(0, 1).Value = 1
  
      Else
      ActiveSheet.Buttons(buttontext).Caption = "Mark as Incomplete"
      ActiveCell.Offset(0, 1).Value = 0
  
  End If
  
  End Sub
  </code></pre>
  
  <p>Following code works:</p>
  
  <pre><code>Sub MarkAllComplete()
  Dim btn As Button
  For Each btn In ActiveSheet.Buttons
  btn.Caption = "Mark as Complete"
  Cells(btn.TopLeftCell.Row, btn.TopLeftCell.Column + 1) = 0
  Next
  End Sub
  </code></pre>