Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 76
Default Hidden Rows not working correctly

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 149
Default Hidden Rows not working correctly

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.

--
HTH,
George


"S Himmelrich" wrote in message
...
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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,533
Default Hidden Rows not working correctly

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

"S Himmelrich" skrev i meddelelsen
...
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


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
VLookup is not working correctly Eric @ BP-EVV Excel Worksheet Functions 3 July 18th 08 12:24 AM
Rows hidden by Autofilter vs hidden by changing the Hidden property LEO@KCC Excel Programming 4 September 11th 07 10:14 AM
vlookup isn't working correctly? Dave F Excel Discussion (Misc queries) 2 October 14th 06 04:27 AM
This is not working because I didn't write it correctly L.White Excel Programming 14 November 24th 05 10:17 AM
Cursor not working correctly LSOT Excel Discussion (Misc queries) 4 November 1st 05 04:45 PM


All times are GMT +1. The time now is 05:08 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"