ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Hiding Rows if Blank cell (https://www.excelbanter.com/excel-worksheet-functions/83047-hiding-rows-if-blank-cell.html)

mohd21uk via OfficeKB.com

Hiding Rows if Blank cell
 
Hi,

I would like to hide a row if a cell in the row is blank. For e,g.If cell C22
is blank i would like to hide the row. Is there an easy function that would
do this or would I have to use a macro.

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...tions/200604/1

Ardus Petus

Hiding Rows if Blank cell
 
Paste following code in Worksheet's code (right-click on tab name, select
Code)

HTH
--
AP

'------------
Private Sub Worksheet_Change(ByVal Target As Range)
With Range("c22")
.EntireRow.Hidden = (.Value = "")
End With
End Sub
'------------

"mohd21uk via OfficeKB.com" <u20517@uwe a écrit dans le message de
news:5eb4fedd25850@uwe...
Hi,

I would like to hide a row if a cell in the row is blank. For e,g.If cell

C22
is blank i would like to hide the row. Is there an easy function that

would
do this or would I have to use a macro.

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...tions/200604/1




Bob Phillips

Hiding Rows if Blank cell
 
You nee VBA

For i = Cells(Rows.Count,"C").End(xlUp).Row to 1 Step -1
If Cells(i,"C").Value = "" Then
Rows(i)Hidden = True
End If
Next i

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"mohd21uk via OfficeKB.com" <u20517@uwe wrote in message
news:5eb4fedd25850@uwe...
Hi,

I would like to hide a row if a cell in the row is blank. For e,g.If cell

C22
is blank i would like to hide the row. Is there an easy function that

would
do this or would I have to use a macro.

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...tions/200604/1




rajkohli

Hiding Rows if Blank cell
 
You can also try this one. This method will help you to do the said thing in
every old and new workbook, where as you have to paste the code in every
workbook or sheet.

1. Press Ctrl+G to open Goto Window (without selecting anything)
2. Here click the Special button.
3. Click Blanks and press Ok.
4. You will see the all the blank cells within your data will be selected.
5. Press CTRL+9 to hide the selected rows.

Maybe that is what you want. One more thing. To Unhide any hidden rows
within the selection press CTRL+SHIFT+9 or you can say CTRL+SHIFT+( (opening
parenthesis).

Check out the following link, here you will see very useful shortcut key for
Microsoft Excel.

http://office.microsoft.com/en-gb/as...037811033.aspx

If the above was useful to you then let us know!

"mohd21uk via OfficeKB.com" wrote:

Hi,

I would like to hide a row if a cell in the row is blank. For e,g.If cell C22
is blank i would like to hide the row. Is there an easy function that would
do this or would I have to use a macro.

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...tions/200604/1



All times are GMT +1. The time now is 10:58 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com