Assign macro to all your Checkboxes and make sure they are all aligned perfectly in each cell (you might need to increase the rowheight for a perfect fit)
Sub txtbxcheck()
With ActiveSheet.CheckBoxes(Application.Caller)
If .Value = 1 Then
ActiveSheet.Cells(.TopLeftCell.Row, .TopLeftCell.Column + 1) = "=+IF(R[" & 22 - .TopLeftCell.Row & "]C[-2]="""","""",VLOOKUP(R[" & 22 - .TopLeftCell.Row & "]C[-2],'Payment list'!R[1]C[-3]:R[31]C[-2],2))"
Else
ActiveSheet.Cells(.TopLeftCell.Row, .TopLeftCell.Column + 1) = ""
End If
End With
End Sub
Bookmarks