PC Review


Reply
Thread Tools Rate Thread

CF using Toggle Button result

 
 
gtslabs
Guest
Posts: n/a
 
      25th Nov 2008
I am trying to use CF to hide some cells (actually turning the font
color white).
I made a Control Toggle Button and linked it to cell G8.

The cells I want to hide are say B2...B6
I select that range and goto Conditional Formating

2 Questions:

1) How do I write the "formula is" CF expression testing if G8 is TRUE
or FALSE?
I tried G8=TRUE but that is not working.

2)How do I change the caption of the Toggle Button to show different
text if depressed or not.
So I want it to say SHOW and HIDE
 
Reply With Quote
 
 
 
 
Jim Rech
Guest
Posts: n/a
 
      25th Nov 2008
=G8=TRUE should work fine as a CF formula.

You'd need a macro to change the button's caption. Double click the button
while you're in design mode and write code like this:

Private Sub ToggleButton1_Click()
If Range("G8").Value = True Then
ToggleButton1.Caption = "Hide"
Else
ToggleButton1.Caption = "Show"
End If
End Sub

You might have to flip the logic I used. Also, better to use a range name
for cell G8 so if you insert a row, etc., the code still works.

--
Jim
"gtslabs" <(E-Mail Removed)> wrote in message
news:85daf70f-cae6-4253-a81a-(E-Mail Removed)...
|I am trying to use CF to hide some cells (actually turning the font
| color white).
| I made a Control Toggle Button and linked it to cell G8.
|
| The cells I want to hide are say B2...B6
| I select that range and goto Conditional Formating
|
| 2 Questions:
|
| 1) How do I write the "formula is" CF expression testing if G8 is TRUE
| or FALSE?
| I tried G8=TRUE but that is not working.
|
| 2)How do I change the caption of the Toggle Button to show different
| text if depressed or not.
| So I want it to say SHOW and HIDE

 
Reply With Quote
 
vezerid
Guest
Posts: n/a
 
      25th Nov 2008
On the issue of Formula Is, you need $$ because the formula in CF is
copied identically to cell formulas.

=$G$8=TRUE

HTH
Kostis Vezerides

On Nov 25, 4:52*pm, gtslabs <gtsl...@comcast.net> wrote:
> I am trying to use CF to hide some cells (actually turning the font
> color white).
> I made a Control Toggle Button and linked it to cell G8.
>
> The cells I want to hide are say B2...B6
> I select that range and goto Conditional Formating
>
> 2 Questions:
>
> 1) How do I write the "formula is" CF expression testing if G8 is TRUE
> or FALSE?
> I tried G8=TRUE but that is not working.
>
> 2)How do I change the caption of the Toggle Button to show different
> text if depressed or not.
> So I want it to say SHOW and HIDE


 
Reply With Quote
 
David Biddulph
Guest
Posts: n/a
 
      25th Nov 2008
Do you need the =TRUE? Wouldn't =$G$8 do it?
--
David Biddulph


"vezerid" <(E-Mail Removed)> wrote in message
news:0d96a887-4538-4c79-8f53-(E-Mail Removed)...
On the issue of Formula Is, you need $$ because the formula in CF is
copied identically to cell formulas.

=$G$8=TRUE

HTH
Kostis Vezerides

On Nov 25, 4:52 pm, gtslabs <gtsl...@comcast.net> wrote:
> I am trying to use CF to hide some cells (actually turning the font
> color white).
> I made a Control Toggle Button and linked it to cell G8.
>
> The cells I want to hide are say B2...B6
> I select that range and goto Conditional Formating
>
> 2 Questions:
>
> 1) How do I write the "formula is" CF expression testing if G8 is TRUE
> or FALSE?
> I tried G8=TRUE but that is not working.
>
> 2)How do I change the caption of the Toggle Button to show different
> text if depressed or not.
> So I want it to say SHOW and HIDE



 
Reply With Quote
 
vezerid
Guest
Posts: n/a
 
      25th Nov 2008
Personally I would not put it but I thought that I should maintain the
philosophy the OP used for his formula.

To the OP: Anything numeric and non-zero counts as TRUE in logical
context. Hence, especially since your formula in G8 is logical and
returns TRUE/FALSE, it would be enough to use the simplified formula
as David suggested.

Kostis

On Nov 25, 6:13*pm, "David Biddulph" <groups [at] biddulph.org.uk>
wrote:
> Do you need the =TRUE? *Wouldn't =$G$8 do it?
> --
> David Biddulph
>
> "vezerid" <veze...@act.edu> wrote in message
>
> news:0d96a887-4538-4c79-8f53-(E-Mail Removed)...
> On the issue of Formula Is, you need $$ because the formula in CF is
> copied identically to cell formulas.
>
> =$G$8=TRUE
>
> HTH
> Kostis Vezerides
>
> On Nov 25, 4:52 pm, gtslabs <gtsl...@comcast.net> wrote:
>
> > I am trying to use CF to hide some cells (actually turning the font
> > color white).
> > I made a Control Toggle Button and linked it to cell G8.

>
> > The cells I want to hide are say B2...B6
> > I select that range and goto Conditional Formating

>
> > 2 Questions:

>
> > 1) How do I write the "formula is" CF expression testing if G8 is TRUE
> > or FALSE?
> > I tried G8=TRUE but that is not working.

>
> > 2)How do I change the caption of the Toggle Button to show different
> > text if depressed or not.
> > So I want it to say SHOW and HIDE


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
toggle button should change tooltip on toggle? not_a_commie Microsoft C# .NET 1 3rd Aug 2010 02:23 AM
how to avoid clicking toggle field code each time to view result Lane Microsoft Word Document Management 5 3rd Feb 2009 08:55 PM
Toggle Challenge - Toggle button to show or hide a subform Toucan Microsoft Access 6 16th Oct 2008 11:22 AM
Turning a radio button into a toggle button Jeff Ciaccio Microsoft VB .NET 8 27th Jun 2008 04:39 AM
Adding .xla button for Toggle Calculation Button =?Utf-8?B?TWlrZQ==?= Microsoft Excel Programming 2 19th Aug 2005 03:28 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:28 PM.