Reset Sheet

  • Thread starter Thread starter Todd
  • Start date Start date
T

Todd

I have code such as the following linked to a command
button that when the checkboxes are selected and the
command button pressed it will turn the appropriate range
of cells yellow. I would like to have an additional
button that when pressed will reset the form back to the
original view where the checkboxes are not selected and
the range of cells are white which is the color they begin
as. Any help on this is greatly appreciated. Thanks!

Public Sub Seasonal()
Sheets("Form").Visible = True
If Worksheets("Index").CheckBox15.Value = False Then Exit
Sub
Sheets("Form").Activate
ActiveSheet.Range("Seasonal").Select
Selection.Interior.ColorIndex = 6


End Sub
 
This may get you started.

Public Sub Seasonal_off()
dim OLEObj as oleobject

with worksheets("form")
.visible = xlsheethidden ''''or xlsheetvisible
for each oleobj in .oleobjects
if typeof oleobj.object is msforms.checkbox then
oleobj.object.value = false
end if
next oleobj
.range("seasonal").interior.colorindex = xlnone
end with

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top