View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
timebird timebird is offline
external usenet poster
 
Posts: 16
Default toggle button in excel

you can hide or show columns & rows by setting Hidden property True or False
If you want to toggle it, you need to use Not operator as following:
rng.EntireRow.Hidden = Not rng.EntireRow.Hidden
rng.EntireColumn.Hidden = Not rng.EntireColumn.Hidden

where rng is a Range object variable.
--
msn
---------------------------------------------
the best time to plant a tree was twenty years ago.
the second best time, is today - Chinese proverb



"lharthur" wrote:

I would like to use a toggle button to hide and unhide several columns and
rows.
The first thing I did was to create 2 macros 1 to hide and other to unhide.
But now I would like to link those macros in a toggle button. I have tried
but no results. Is any idea around? Thanks