Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Need help using a toggle button


Hello,

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

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

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

Can anyone provide any assistance?

Thanks in advance

--
tanktat
-----------------------------------------------------------------------
tanktata's Profile: http://www.excelforum.com/member.php...nfo&userid=459
View this thread: http://www.excelforum.com/showthread.php?threadid=55656

  #2   Report Post  
Posted to microsoft.public.excel.programming
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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Need help using a toggle button


Thanks for the help so far. The code you have given only hides an
unhides the data.

Its the protection of the data that I cant really seem to get working

--
tanktat
-----------------------------------------------------------------------
tanktata's Profile: http://www.excelforum.com/member.php...nfo&userid=459
View this thread: http://www.excelforum.com/showthread.php?threadid=55656

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Need help using a toggle button


ActiveSheet.Protect DrawingObjects:=True, Contents:=True
Scenarios:=Tru

--
Bearacad

-----------------------------------------------------------------------
Bearacade's Profile: http://www.excelforum.com/member.php...fo&userid=3501
View this thread: http://www.excelforum.com/showthread.php?threadid=55656

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Need help using a toggle button


I know how to protect a sheet, but I cant get the toggle button t
protect/unprotect a worksheet that contains unlocked cell

--
tanktat
-----------------------------------------------------------------------
tanktata's Profile: http://www.excelforum.com/member.php...nfo&userid=459
View this thread: http://www.excelforum.com/showthread.php?threadid=55656



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Need help using a toggle button


Columns("C:C").Select
Selection.EntireColumn.Hidden = True
ActiveSheet.Protect DrawingObjects:=True, Contents:=True
Scenarios:=True

HT

--
Bearacad

-----------------------------------------------------------------------
Bearacade's Profile: http://www.excelforum.com/member.php...fo&userid=3501
View this thread: http://www.excelforum.com/showthread.php?threadid=55656

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Need to Use 1 Button to toggle On or Off Jim May Excel Discussion (Misc queries) 2 December 1st 07 08:01 PM
Toggle Button NavEx Excel Worksheet Functions 1 May 23rd 06 02:40 AM
Toggle Button Dave_2k5[_7_] Excel Programming 4 September 1st 05 10:55 AM
Adding .xla button for Toggle Calculation Button Mike Excel Programming 5 August 19th 05 01:55 PM
Toggle Button Ben E[_2_] Excel Programming 1 October 29th 03 04:42 PM


All times are GMT +1. The time now is 06:39 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"