hide a row

cgriff

Board Regular
Joined
Aug 26, 2002
Messages
201
can I hide a row base on a condition of a cell in another row

I dont want to make the row height zero
any ideas

Thanks in advance
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop

Mark W.

MrExcel MVP
Joined
Feb 10, 2002
Messages
11,654
Hiding a row is accomplished by setting its Height to 0. have you considered using an Advanced AutoFilter perhaps inconjunction with a Custom View?
 

cgriff

Board Regular
Joined
Aug 26, 2002
Messages
201
Thanks for that if this is the best way how can I unhide the row

Cheers
 

lenze

Legend
Joined
Feb 18, 2002
Messages
13,690
Mark is correct, but you can accomplish this with code. Place this in the Sheet module

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$B$3" Then
If Target.Text = "hide" Then Range("$A$5").EntireRow.Hidden = True
If Target.Text<> "hide" Then Range("$A$5").EntireRow.Hidden = False
End If
End Sub

This will hide row 5 whenever "hide" is entered in B3. Adjust as needed

Edit: you maight also want to look at this thread
http://216.92.17.166/board/viewtopic.php?topic=24792&forum=2
This message was edited by lenze on 2002-10-10 16:29
 

cgriff

Board Regular
Joined
Aug 26, 2002
Messages
201
Thanks lenze
can you tell me the code to hide cells in a different sheet
 

lenze

Legend
Joined
Feb 18, 2002
Messages
13,690
Untested but try using

Sheet2.Range("$A$5).EntireRow.Hidden etc

or Sheets("SheetName").Range("$S$5").EntireRow etc

Edit: you may have to Activate the sheet in the code.
This message was edited by lenze on 2002-10-10 17:58
 

Forum statistics

Threads
1,144,208
Messages
5,723,032
Members
422,476
Latest member
beck85

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top