Hi. I am not a VB programmer, but I expect the answer would be easy for those who are. I have a simple VB routine running on a spreadsheet that clears the contents of a cell when the value has been changes. I would like to add a checkbox to my spreadsheet to turn on or off this feature (basically bypass the code). Have not been having much luck. Tried simple GoTo but evidently did not do it right as I cannot get it to react to the checkbox. Any suggestion are greatly appreciated. A sample of code is below:
Obviously not elegant, but works fine for what I need.
Thanks in advance
Private Sub Worksheet_Change(ByVal Target As Range)
'Comment: if severity changes, clear Solution and Risk Reduction Method
If Target.Address = "$E$19" Then Range("$T$19").ClearContents
If Target.Address = "$E$20" Then Range("$T$20").ClearContents
If Target.Address = "$E$21" Then Range("$T$21").ClearContents
If Target.Address = "$E$22" Then Range("$T$22").ClearContents
If Target.Address = "$E$23" Then Range("$T$23").ClearContents
If Target.Address = "$E$24" Then Range("$T$24").ClearContents
If Target.Address = "$E$25" Then Range("$T$25").ClearContents
If Target.Address = "$E$26" Then Range("$T$26").ClearContents
If Target.Address = "$E$27" Then Range("$T$27").ClearContents
If Target.Address = "$E$28" Then Range("$T$28").ClearContents
If Target.Address = "$E$29" Then Range("$T$29").ClearContents
on and on until
on and on until
If Target.Address = "$G$124" Then Range("$T$124").ClearContents
If Target.Address = "$G$125" Then Range("$T$125").ClearContents
If Target.Address = "$G$126" Then Range("$T$126").ClearContents
If Target.Address = "$G$127" Then Range("$T$127").ClearContents
If Target.Address = "$G$128" Then Range("$T$128").ClearContents
If Target.Address = "$G$129" Then Range("$T$129").ClearContents
End Sub
Obviously not elegant, but works fine for what I need.
Thanks in advance