hide/unhide cell when clicking a cmdbutton

  • Thread starter Thread starter harder1216
  • Start date Start date
H

harder1216

hide/unhide cell when clicking a cmdbutton

--------------------------------------------------------------------------------

hi! im a new member here.

just want to ask for help.

how can i hide/unhide cell when clicking a cmd button.

for example:

when i click the button "November" the data of november
will appear(b3:f25) but when i click again the button november,
it will hide the cell i just viewed.

thank you.[/COLOR
 
Hi

the problem is that you can't hide just cells - you need to hide either rows
or columns .. so if you're happy for columns B:F to be hidden when you click
your button then

sub ToggleNovember()

Columns("B:F").Select
if Selection.EntireColumn.Hidden = True then
Selection.EntireColumn.Hidden = False
else
Selection.EntireColumn.Hidden = True
end if

Range("A1").select

end sub


hope this helps
Cheers
JulieD
 

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