M
Minitman
Greetings,
I recently broke a worksheet off of a large workbook and made it into
a single sheet workbook. I kept the sheet code for the clearing
process. This code is located in the sheet code area. After clearing
all entries the code changed the color of a button and two cells (to
announce that it has finished clearing. Big sheet - took time).
This part is working. It is the second part that stopped working
after the break off!
This second part is set to trigger when the sheet is activated. It
changes the color of the button and the same two cells back to their
original color. It is not triggering.
Here are the subs:
======================================================
Private Sub ButtonClearAll_Click()
If MsgBox("Do you want to Clear ALL data from " & _
"this sheet?", vbYesNo + vbDefaultButton1) = _
vbYes Then ClearSheet
End Sub
__________________________________________________________
Sub ClearSheet()
Range("rInv").Value = vbNullString
ButtonClearAll.BackColor = &HFF00&
Range("C1:C2").Interior.ColorIndex = 4
End Sub
__________________________________________________________
Private Sub Worksheet_Activate()
ButtonClearAll.BackColor = &HFFFF&
Range("C1:C2").Interior.ColorIndex = 6
Calculate
End Sub
====================================================
Range("rInv") is the range cleared. ButtonClearAll is the button that
starts the procedure and Range("C1:C2") are the two cells that have
the color change to signal procedure completion.
Did I miss something?
Anybody see any reason why the Worksheet_Activate event is not
working?
Any help will be appreciated.
-Minitman
I recently broke a worksheet off of a large workbook and made it into
a single sheet workbook. I kept the sheet code for the clearing
process. This code is located in the sheet code area. After clearing
all entries the code changed the color of a button and two cells (to
announce that it has finished clearing. Big sheet - took time).
This part is working. It is the second part that stopped working
after the break off!
This second part is set to trigger when the sheet is activated. It
changes the color of the button and the same two cells back to their
original color. It is not triggering.
Here are the subs:
======================================================
Private Sub ButtonClearAll_Click()
If MsgBox("Do you want to Clear ALL data from " & _
"this sheet?", vbYesNo + vbDefaultButton1) = _
vbYes Then ClearSheet
End Sub
__________________________________________________________
Sub ClearSheet()
Range("rInv").Value = vbNullString
ButtonClearAll.BackColor = &HFF00&
Range("C1:C2").Interior.ColorIndex = 4
End Sub
__________________________________________________________
Private Sub Worksheet_Activate()
ButtonClearAll.BackColor = &HFFFF&
Range("C1:C2").Interior.ColorIndex = 6
Calculate
End Sub
====================================================
Range("rInv") is the range cleared. ButtonClearAll is the button that
starts the procedure and Range("C1:C2") are the two cells that have
the color change to signal procedure completion.
Did I miss something?
Anybody see any reason why the Worksheet_Activate event is not
working?
Any help will be appreciated.
-Minitman