I'm going to show you how to hide and unhide parts of a form with the use of
checkboxes so for example I have let's pretend this is a form and extra detail
exists in my red part here or in my blue part the average user doesn't need to
see these all the time but if they'd like to see them they also have the
ability to look them up so let's go to our Developer tab let's go to insert
from our toolbox here and we're going to choose the the checkbox and the ActiveX
controls and I'm going to click cross my Alt key and click and then I have
checkbox one so now what I'm gonna do is I want to hide hide and unhide my red
area here so what I'm gonna do is I'm going to right click here and I'm gonna
go into view code so we're gonna say just amend I'm gonna put a couple lines
here so we're gonna say if check box 1 equals false then then I'm going to I'm
gonna hide the rows 13 through 20 hidden equals true and then we tab in here and
then we're gonna go else and then we're gonna go then we're gonna say else if
it's not if it's full if it's true then we're gonna have hidden rows false so
what I'm gonna do here is I'm going to end my out yep and then let's try this
out so this box is checked so then we we have the the the red area is visible if
we click it off the red area disappears so to view the red area you would click
this so now let's change this so what we're gonna do is we're
gonna write we're gonna go to design mode and we're gonna go right click on
the we're gonna right click on this and we're gonna get properties and from the
properties box what I'm gonna do is I'm gonna change the caption it's not we're
gonna still have it called check one or checkbox one but let's change the
caption and so I'm gonna call it red stuff okay
now we bring this way so we don't need to see it go it off design mode and so
with the red red stuff checked you see the red stuff with the red stuff
unchecked you don't see it now I can do the same for Rose so I'm going back to
my toolbar through my toolbox here I'm gonna choose the check box from the
ActiveX controls and I'm gonna go right about here and I'm going to press
clicked and so we have check box too we view the code and for this one what
we're going to do is we are going to hide we're gonna hide columns klm so
let's go back what we're gonna do is we're gonna go we're gonna do basically
the same thing as we did for the other one except for we're going to use
columns I have here checkbox true then columns k2 and hidden equals false else
case um hidden equals true okay now let's go back to the front here and
we'll go to design mode if we want to see the blue blue stuff we check the
boxes and it comes up and if you don't want to see any of the detail you
uncheck both of the boxes and they're there if you want to see all of the
detail
so there you have both boxes are checked and you see both of the details you can
take off one box and you lose the blue detail take off the other box and take
off the red detail yeah you could go into properties again onto this blue one
and call it blue stuff or you can just leave it as checkbox too if you like so
that's how you hide parts of your form in Excel please subscribe