Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 33
Default Hiding selected Row

Hello,

I would like to hide an entire row, only if the User selects a "X" in Column
B.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Hiding selected Row

Try this:

Sub HideRows1()
Worksheets("Jul").Unprotect Password:="abcd"

' Hide Selected Rows on the Worksheet
For each c in ("B11:B119")
If c.value = "X" then
..EntireRow.Hidden = True
Else
..EntireRow.Hidden = False
End if
Next

Range("C11").Select
Worksheets("Aug").Protect Password:="abcd", Scenarios:=True

End Sub

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Hiding selected Row

If the cells will either be blank or contain an X then

Sub HideRows1()
Worksheets("Jul").Unprotect Password:="abcd"

' Hide Selected Rows on the Worksheet
With Range("B11:B119")
.EntireRow.Hidden = False
On Error Resume Next
.SpecialCells(xlConstants,xlTextValues).EntireRow. Hidden = True
On Error goto 0
End With
Range("C11").Select
Worksheets("Aug").Protect Password:="abcd", Scenarios:=True

End Sub


--
Regards,
Tom Ogilvy


"Ruan" wrote in message
...
Hello,

I would like to hide an entire row, only if the User selects a "X" in

Column
B.

Below is the code I used to hide rows that had blank values in Column B.

How
would I modify this code to look for a "X" value?

Sub HideRows1()
Worksheets("Jul").Unprotect Password:="abcd"

' Hide Selected Rows on the Worksheet
With Range("B11:B119")
.EntireRow.Hidden = False
.SpecialCells(xlCellTypeBlanks).EntireRow.Hidden = True
End With
Range("C11").Select
Worksheets("Aug").Protect Password:="abcd", Scenarios:=True

End Sub


Thanks
Ruan




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 33
Default Hiding selected Row

Thanks Chan. I get an error when I run the code though. I will keep playing
with it.
Ruan



"Chan" wrote in message
...
Try this:

Sub HideRows1()
Worksheets("Jul").Unprotect Password:="abcd"

' Hide Selected Rows on the Worksheet
For each c in ("B11:B119")
If c.value = "X" then
.EntireRow.Hidden = True
Else
.EntireRow.Hidden = False
End if
Next

Range("C11").Select
Worksheets("Aug").Protect Password:="abcd", Scenarios:=True

End Sub



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 33
Default Hiding selected Row

Thanks Tom. It works great.


"Tom Ogilvy" wrote in message
...
If the cells will either be blank or contain an X then

Sub HideRows1()
Worksheets("Jul").Unprotect Password:="abcd"

' Hide Selected Rows on the Worksheet
With Range("B11:B119")
.EntireRow.Hidden = False
On Error Resume Next
.SpecialCells(xlConstants,xlTextValues).EntireRow. Hidden = True
On Error goto 0
End With
Range("C11").Select
Worksheets("Aug").Protect Password:="abcd", Scenarios:=True

End Sub


--
Regards,
Tom Ogilvy


"Ruan" wrote in message
...
Hello,

I would like to hide an entire row, only if the User selects a "X" in

Column
B.

Below is the code I used to hide rows that had blank values in Column B.

How
would I modify this code to look for a "X" value?

Sub HideRows1()
Worksheets("Jul").Unprotect Password:="abcd"

' Hide Selected Rows on the Worksheet
With Range("B11:B119")
.EntireRow.Hidden = False
.SpecialCells(xlCellTypeBlanks).EntireRow.Hidden = True
End With
Range("C11").Select
Worksheets("Aug").Protect Password:="abcd", Scenarios:=True

End Sub


Thanks
Ruan






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
Color alternate rows when after hiding selected rows Monk[_2_] Excel Worksheet Functions 6 June 7th 08 01:36 AM
Hiding worksheet unless selected SAP PoD Excel Discussion (Misc queries) 2 August 18th 06 03:45 PM
Hiding a button when hiding rows fergusor Excel Discussion (Misc queries) 2 August 10th 06 02:31 PM
how do i make it so that when a sheat is selected either via link or tab, that xlLastCell is selected. the last on the sheet. Daniel Excel Worksheet Functions 1 July 12th 05 01:30 AM
hiding gridlines in selected cell areas Nong Excel Discussion (Misc queries) 2 July 3rd 05 02:46 AM


All times are GMT +1. The time now is 02:36 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"