View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Iain King Iain King is offline
external usenet poster
 
Posts: 32
Default Hiding rows by a logic formula


I am using a check box (forms version) to give a second
option for a standard calcultion sheet. Under the first
option it requires just one row. For the second it would
require an additional 3 rows. I would like to hide the
additional 3 rows if the default calc is being made. So
they would be unhiden under once the check box is check
and the second calculation is being perfomed. Can anyone
help me out on how to coordinate this action.


you have to enter code into the CheckBox's Change event:
assuming your sheet is called MySheet, checkbox is MyCheckbox.
you have to select the rows you want to hide/unhide and Define a name for
them ("ExtraRows")

private sub MyCheckBox_Change()
if MyCheckBox.Value then 'checkbox is ticked
Sheets("MySheet").Range("ExtraRows").EntireRow.Hid den = false
else
Sheets("MySheet").Range("ExtraRows").EntireRow.Hid den = true
endif
end sub


Iain King