Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Conditional hide rows macros
What I want to do is:
If data is in a certain cell then I want to unhide a row and if there is nothing in the certain cell then I want the row to be hidden. I understand there is no actual worksheet function to do this but you can use a macro for this. I have no idea about macros which is my only problem with using them. Any suggestions will be useful. Thank you ------------------------------------------------ ~~ Message posted from http://www.ExcelTip.com/ ~~ View and post usenet messages directly from http://www.ExcelForum.com/ |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Conditional hide rows macros
Stu
Here's a primer on using VBA in Excel http://www.mvps.org/dmcritchie/excel/getstarted.htm For you particular problem, you need to identify the Range object that is that cell and test its Value property. Based on that test, you would use the EntireRow property to return a Range object that encompasses the entire row and use the Hidden property to hide or unhide it. Here's a basic example If Range("A1").Value = 3 Then Range("A1").EntireRow.Hidden = True Else Range("A1").EntireRow.Hidden = False End If If you want to check a number of cells, you can use a For Each construct to loop through all the cells in a particular range. Here's an example of that Dim Cell as Range For Each Cell in Range("C1:C10").Cells If Cell.Value = 3 Then Cell.EntireRow.Hidden = True Else Cell.EntireRow.Hidden = False End If Next Cell -- Dick Kusleika MVP - Excel www.dicks-clicks.com Post all replies to the newsgroup. "Stu" wrote in message ... What I want to do is: If data is in a certain cell then I want to unhide a row and if there is nothing in the certain cell then I want the row to be hidden. I understand there is no actual worksheet function to do this but you can use a macro for this. I have no idea about macros which is my only problem with using them. Any suggestions will be useful. Thank you ------------------------------------------------ ~~ Message posted from http://www.ExcelTip.com/ ~~ View and post usenet messages directly from http://www.ExcelForum.com/ |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Hide rows with conditional formatting | Excel Discussion (Misc queries) | |||
Easy way to Hide & Show Rows and update associated macros | Excel Discussion (Misc queries) | |||
Easy way to Hide & Show Rows and update associated macros | Excel Discussion (Misc queries) | |||
Using VBA to Conditional Hide Rows? | Excel Discussion (Misc queries) | |||
Conditional Hide/Unhide Rows | Excel Discussion (Misc queries) |