Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Mon
 
Posts: n/a
Default Display cells when box is checked

I tried VBA code that was posted earlier...
the code is:

Private Sub CheckBox1_Click()
Dim myRng as Range
Set myRng = Me.Range("A20:A29").EntireRow (obviously suited to my range)
myRng.Hidden = Me.CheckBox1.Value
End Sub

What this does is make it so that the rows are showing when the checkbox is
NOT checked and once the checkbox IS checked, the rows are HIDDEN. How do I
make it the other way around? I want to Check the box and have what was
hidden now be visible.
Obviously I'm new at the codes, etc.
thanks!
  #2   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson
 
Posts: n/a
Default Display cells when box is checked

maybe

myRng.Hidden = not Me.CheckBox1.Value


Mon wrote:

I tried VBA code that was posted earlier...
the code is:

Private Sub CheckBox1_Click()
Dim myRng as Range
Set myRng = Me.Range("A20:A29").EntireRow (obviously suited to my range)
myRng.Hidden = Me.CheckBox1.Value
End Sub

What this does is make it so that the rows are showing when the checkbox is
NOT checked and once the checkbox IS checked, the rows are HIDDEN. How do I
make it the other way around? I want to Check the box and have what was
hidden now be visible.
Obviously I'm new at the codes, etc.
thanks!


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.misc
Mon
 
Posts: n/a
Default Display cells when box is checked

GREAT - it worked! Thank you!!
Now, is it possible to change the font size or make the Title to the Check
Box Bold??
I need to show that it's a pretty big or important option in the form...

thanks!

"Dave Peterson" wrote:

maybe

myRng.Hidden = not Me.CheckBox1.Value


Mon wrote:

I tried VBA code that was posted earlier...
the code is:

Private Sub CheckBox1_Click()
Dim myRng as Range
Set myRng = Me.Range("A20:A29").EntireRow (obviously suited to my range)
myRng.Hidden = Me.CheckBox1.Value
End Sub

What this does is make it so that the rows are showing when the checkbox is
NOT checked and once the checkbox IS checked, the rows are HIDDEN. How do I
make it the other way around? I want to Check the box and have what was
hidden now be visible.
Obviously I'm new at the codes, etc.
thanks!


--

Dave Peterson

  #4   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson
 
Posts: n/a
Default Display cells when box is checked

Maybe...

Option Explicit
Private Sub CheckBox1_Click()
Dim myRng As Range
Set myRng = Me.Range("A20:A29").EntireRow
myRng.Hidden = Not Me.CheckBox1.Value
Me.CheckBox1.Font.Bold = Me.CheckBox1.Value
End Sub

Add the "NOT" if you want--not sure when it should be bold.

If you always want it bold, then show its properties and doubleclick on Font.
You can change the font and boldness there.

Mon wrote:

GREAT - it worked! Thank you!!
Now, is it possible to change the font size or make the Title to the Check
Box Bold??
I need to show that it's a pretty big or important option in the form...

thanks!

"Dave Peterson" wrote:

maybe

myRng.Hidden = not Me.CheckBox1.Value


Mon wrote:

I tried VBA code that was posted earlier...
the code is:

Private Sub CheckBox1_Click()
Dim myRng as Range
Set myRng = Me.Range("A20:A29").EntireRow (obviously suited to my range)
myRng.Hidden = Me.CheckBox1.Value
End Sub

What this does is make it so that the rows are showing when the checkbox is
NOT checked and once the checkbox IS checked, the rows are HIDDEN. How do I
make it the other way around? I want to Check the box and have what was
hidden now be visible.
Obviously I'm new at the codes, etc.
thanks!


--

Dave Peterson


--

Dave Peterson
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
How do I get Excel to display a range of cells with a check box? bobm Excel Discussion (Misc queries) 2 October 21st 05 07:37 PM
Display only certain cells ringersoll Excel Worksheet Functions 2 October 20th 05 08:19 PM
Cells formated as text do not always display properly Cass Excel Discussion (Misc queries) 2 July 23rd 05 01:59 AM
Display empty cells botany_girl Excel Discussion (Misc queries) 7 July 19th 05 06:40 PM
Display empty cells botany_girl Excel Discussion (Misc queries) 1 July 19th 05 05:51 PM


All times are GMT +1. The time now is 11:31 PM.

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"