View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Chip Pearson Chip Pearson is offline
external usenet poster
 
Posts: 7,247
Default Need help using a toggle button

Try something like in the sheet's code module.

Private Sub ToggleButton1_Click()
If Me.ToggleButton1.Value = True Then
Me.Columns("A").Hidden = False
Me.Columns("C").Hidden = True
Else
Me.Columns("A").Hidden = True
Me.Columns("C").Hidden = False
End If
End Sub



--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"tanktata"
wrote in
message
...

Hello,

I am trying to create a spreadsheet in excel 2003, which has a
toggle
button on it. When I press the button, I want the sheet to
display two
different sets of data, for example, display data in ColumnA
and hide
ColumnC and vice versa.

I am also trying to add protection to the sheet so that when
ColumnA is
shown, the rest of the sheet is protected, so no data in
ColumnC can be
deleted accidentally.

I think it should be really easy, but I cannot get it work. :(

Can anyone provide any assistance?

Thanks in advance.


--
tanktata
------------------------------------------------------------------------
tanktata's Profile:
http://www.excelforum.com/member.php...fo&userid=4598
View this thread:
http://www.excelforum.com/showthread...hreadid=556566