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 / New Users / December 2006

Tip: Looking for answers? Try searching our database.

Hide Rows in one W/S Based on a cell value in Another W/S

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
christopher.hubbard@gmail.com - 12 Dec 2006 21:43 GMT
Hide Rows in one W/S Based on a cell value in Another W/S

I have the following code in an excel spreadsheet (see below).  The
code correctly hides the rows when C98 in one worksheet = "Dog" but
when C98 does not = "Dog" it does not unhide the cells on Sheet Blue.
Why?

Select Case UCase(Range("C98").Value)
Case "Dog"
Sheets("Blue").Rows("94:113").EntireRow.Hidden = False
Case Else
Sheets("Blue").Rows("94:113").EntireRow.Hidden = True
End Select
Don Guillett - 12 Dec 2006 21:54 GMT
Maybe your have your true/false mixed up
Signature

Don Guillett
SalesAid Software
dguillett1@austin.rr.com

> Hide Rows in one W/S Based on a cell value in Another W/S
>
[quoted text clipped - 9 lines]
> Sheets("Blue").Rows("94:113").EntireRow.Hidden = True
> End Select
Bob Phillips - 12 Dec 2006 22:01 GMT
You upshift the value, but test against proper case, as well as having the
TRUE/FALSE revresed.. Shouldn't it be

Select Case UCase(Range("C98").Value)
Case "DOG"
Sheets("Blue").Rows("94:113").EntireRow.Hidden = True
Case Else
Sheets("Blue").Rows("94:113").EntireRow.Hidden = False
End Select

Signature

---
HTH

Bob

(change the xxxx to gmail if mailing direct)

> Hide Rows in one W/S Based on a cell value in Another W/S
>
[quoted text clipped - 9 lines]
> Sheets("Blue").Rows("94:113").EntireRow.Hidden = True
> End Select
CH - 13 Dec 2006 14:32 GMT
> You upshift the value, but test against proper case, as well as having the
> TRUE/FALSE revresed.. Shouldn't it be
[quoted text clipped - 27 lines]
> > Sheets("Blue").Rows("94:113").EntireRow.Hidden = True
> > End Select

Thanks for the help.

For some reason it worked when I capitalized "DOG" rather than using
"Dog"

The False and True weren't mixed up, thats they way I wanted it to
function.
Dave Peterson - 13 Dec 2006 14:54 GMT
That's why Bob capitalized it.

> Select Case UCase(Range("C98").Value)
> Case "DOG"

If you're going to use UCase(), then you'll want all your comparisons against
upper case strings--otherwise, you'll never get a match.

> > You upshift the value, but test against proper case, as well as having the
> > TRUE/FALSE revresed.. Shouldn't it be
[quoted text clipped - 35 lines]
> The False and True weren't mixed up, thats they way I wanted it to
> function.

Signature

Dave Peterson

Don Guillett - 13 Dec 2006 14:54 GMT
I'm sure that Bob meant to do that. The ucase(   forces excel to compare
apples and apples regardless of how the user typed it. dog Dog dOG, etc.
Select Case UCase(Range("C98").Value)
> > Case "DOG"

Signature

Don Guillett
SalesAid Software
dguillett1@austin.rr.com

>
>> You upshift the value, but test against proper case, as well as having
[quoted text clipped - 37 lines]
> The False and True weren't mixed up, thats they way I wanted it to
> function.
Don Guillett - 13 Dec 2006 16:14 GMT
I just re-read and Bob DID capitalize it.

Signature

Don Guillett
SalesAid Software
dguillett1@austin.rr.com

> I'm sure that Bob meant to do that. The ucase(   forces excel to compare
> apples and apples regardless of how the user typed it. dog Dog dOG, etc.
[quoted text clipped - 41 lines]
>> The False and True weren't mixed up, thats they way I wanted it to
>> function.
CH - 14 Dec 2006 12:52 GMT
Thanks for the help everyone.

> I just re-read and Bob DID capitalize it.
>
[quoted text clipped - 52 lines]
> >> The False and True weren't mixed up, thats they way I wanted it to
> >> function.
 
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.