ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Hiding Rows Without Using VBA (https://www.excelbanter.com/excel-programming/303071-hiding-rows-without-using-vba.html)

Michael[_27_]

Hiding Rows Without Using VBA
 
Hi everyone,

Can you do something like:

In a cell such as F1, can you type thing like: If B1=1, then hide row 1?

If there is no way but using VBA, what such a code should look like?

Regards,
Mike

Ed[_18_]

Hiding Rows Without Using VBA
 
Assuming you are in row 1, the VBA could be
If Range("B1") = 1 Then
ActiveCell.EntireRow.Hidden = True
End If

Ed

"Michael" wrote in message
om...
Hi everyone,

Can you do something like:

In a cell such as F1, can you type thing like: If B1=1, then hide row 1?

If there is no way but using VBA, what such a code should look like?

Regards,
Mike




DavidC[_2_]

Hiding Rows Without Using VBA
 
Try this

If ActiveSheet.Range("B1").Value = 1 Then

ActiveSheet.Rows("1").Hidden = False

Else

End If

Best of luck
DavidC
-----Original Message-----
Hi everyone,

Can you do something like:

In a cell such as F1, can you type thing like: If B1=1,

then hide row 1?

If there is no way but using VBA, what such a code should

look like?

Regards,
Mike
.


Michael[_27_]

Hiding Rows Without Using VBA
 
"DavidC" wrote in message ...
Try this

If ActiveSheet.Range("B1").Value = 1 Then

ActiveSheet.Rows("1").Hidden = False

Else

End If

Best of luck
DavidC
-----Original Message-----
Hi everyone,

Can you do something like:

In a cell such as F1, can you type thing like: If B1=1,

then hide row 1?

If there is no way but using VBA, what such a code should

look like?

Regards,
Mike
.



I am using this but not working:

Set rngBlock = Workbooks(filename).Worksheets("ParetoTable").Rang e("B10:B59")

For Each rngCell In rngBlock
If rngCell.Value < 1 Then
ActiveCell.EntireRow.Hidden = True
End If
Next rngCell

It gives no error but not hiding anything? Anything wrong please?

Regards,
Mike

Berend Botje[_27_]

Hiding Rows Without Using VBA
 
You can only hide entire rows or columns. That is why your script doe
not work

--
Message posted from http://www.ExcelForum.com


Michael Sultan

Hiding Rows Without Using VBA
 

Okay, but if the range is NOT known in advance and you have to go row by
row, check, and decide row-by-row, how the above VBA piece of code can
be modified to do so?

Regards,
Mike


*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!


All times are GMT +1. The time now is 01:33 PM.

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