I'm running into a problem with a Macro which contains several checkboxes and subroutines.
Sub 1 is supposed to do something when Checkbox 1 is checked.
Sub 2 is supposed to do something else when Checkbox 2 is checked.
Sub 3 is supposed to erase everything done before (by either Sub 1 or Sub 2) when either Checkbox 1 or Checkbox 2 is unchecked.
The problem I am having is that when I check, say, Checkbox 1, it doesn't show the box as having been checked until Sub 1 and another unexpected subroutine (Sub 3) are completed. Also, until getting to this point, the checkbox also behaves as though it were unchecked and calls Sub 3 as well, although it should only be calling Sub 1 and coming to an end at that point.
Sub Insanity()
If ActiveSheet.CheckBoxes("Check Box 4").Value = xlOn Then
Proc1
End If
If ActiveSheet.CheckBoxes("Check Box 4").Value = xlOff Then
EraseIt
End If
If ActiveSheet.CheckBoxes("Check Box 6").Value = xlOn Then
Proc2
End If
If ActiveSheet.CheckBoxes("Check Box 6").Value = xlOff Then
EraseIt
End If
End Sub
Sub 1 is supposed to do something when Checkbox 1 is checked.
Sub 2 is supposed to do something else when Checkbox 2 is checked.
Sub 3 is supposed to erase everything done before (by either Sub 1 or Sub 2) when either Checkbox 1 or Checkbox 2 is unchecked.
The problem I am having is that when I check, say, Checkbox 1, it doesn't show the box as having been checked until Sub 1 and another unexpected subroutine (Sub 3) are completed. Also, until getting to this point, the checkbox also behaves as though it were unchecked and calls Sub 3 as well, although it should only be calling Sub 1 and coming to an end at that point.
Sub Insanity()
If ActiveSheet.CheckBoxes("Check Box 4").Value = xlOn Then
Proc1
End If
If ActiveSheet.CheckBoxes("Check Box 4").Value = xlOff Then
EraseIt
End If
If ActiveSheet.CheckBoxes("Check Box 6").Value = xlOn Then
Proc2
End If
If ActiveSheet.CheckBoxes("Check Box 6").Value = xlOff Then
EraseIt
End If
End Sub