Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / March 2008

Tip: Looking for answers? Try searching our database.

Hidden Rows not working correctly

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
S Himmelrich - 21 Mar 2008 19:39 GMT
I've got the following code that does hide the rows indicated, but it
also hides rows where the check box is...as you see I've tried to
force the rows it's hiding my mistake to unhide, but that doesn't even
work - HELP?

Dim chkBox As CheckBox
Set chkBox = Worksheets("GTPO_#").CheckBoxes("Check Box 10")
If chkBox.Value = xlOn Then
   'Sheets("GTPO_#").Select
   Rows("75:93").Select
   Selection.EntireRow.Hidden = False
   Rows("21:30").Select
   Selection.EntireRow.Hidden = False
   'Sheets("GTPO_#").Select
' MsgBox "Check Box is checked"
Else
   'Sheets("GTPO_#").Select
   Rows("75:93").Select
   Selection.EntireRow.Hidden = True
   Rows("21:30").Select
   Selection.EntireRow.Hidden = False
   'Sheets("GTPO_#").Select
' MsgBox "Check Box is not checked"
End If
   Rows("21:30").Select
   Selection.EntireRow.Hidden = True
End Sub
George Nicholson - 21 Mar 2008 22:28 GMT
>    Rows("21:30").Select
>    Selection.EntireRow.Hidden = True

Shouldn't that be False?

These last 2 lines of your code will cause Rows("21:30") to *always* be
hidden, which seems like the very opposite of your intention.

Signature

HTH,
George

> I've got the following code that does hide the rows indicated, but it
> also hides rows where the check box is...as you see I've tried to
[quoted text clipped - 23 lines]
>    Selection.EntireRow.Hidden = True
> End Sub
Per Jessen - 21 Mar 2008 22:57 GMT
Hi

I'm a bit confused what it is that you want to hide, but I can see that you
unhide row 21-30 both if the checkbox is checked or not. Then after EndIf
you hide theese rows ??

Regards,

Per

> I've got the following code that does hide the rows indicated, but it
> also hides rows where the check box is...as you see I've tried to
[quoted text clipped - 23 lines]
>    Selection.EntireRow.Hidden = True
> End Sub
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.