Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello,
Somebody can help me with below question ?. I have a sheet with always visible the columns A and B. From the other columns (C till the last used column) some columns (each time different ones) are hidden. In the visible columns some of the records shows registrated data. I need some help for a macro that hide all the rows of the "at that moment visible columns" that contains no registrated data in all the visible columns in the same row. For example,... visible columns: D E H row 3: x x row 4: row 5: x x row 6: x row 7: row 8: x The macro should hide the rows 4 and 7 because the visible columns at that moment shows no registrated data in each record of that specific row (in the shown columns from C till the last used). Regards and waiting for the solution, thanks. Johan |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Try a varioation of:
Set TheRange = ActiveSheet.Range("C3:P15") For Each rw In TheRange.Rows AllBlank = True For Each cll In rw.SpecialCells(xlCellTypeVisible).Cells cll.Select If cll.Value < "" Then AllBlank = False: Exit For Next cll If AllBlank Then rw.Hidden = True Next rw End Sub -- p45cal "johan" wrote: Hello, Somebody can help me with below question ?. I have a sheet with always visible the columns A and B. From the other columns (C till the last used column) some columns (each time different ones) are hidden. In the visible columns some of the records shows registrated data. I need some help for a macro that hide all the rows of the "at that moment visible columns" that contains no registrated data in all the visible columns in the same row. For example,... visible columns: D E H row 3: x x row 4: row 5: x x row 6: x row 7: row 8: x The macro should hide the rows 4 and 7 because the visible columns at that moment shows no registrated data in each record of that specific row (in the shown columns from C till the last used). Regards and waiting for the solution, thanks. Johan |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sorry, I left the top two lines out, here it is in full:
Sub blah() Dim TheRange As Range Set TheRange = ActiveSheet.Range("C3:P15") For Each rw In TheRange.Rows AllBlank = True For Each cll In rw.SpecialCells(xlCellTypeVisible).Cells cll.Select If cll.Value < "" Then AllBlank = False: Exit For Next cll If AllBlank Then rw.Hidden = True Next rw End Sub -- p45cal "p45cal" wrote: Try a variation of: Set TheRange = ActiveSheet.Range("C3:P15") For Each rw In TheRange.Rows AllBlank = True For Each cll In rw.SpecialCells(xlCellTypeVisible).Cells cll.Select If cll.Value < "" Then AllBlank = False: Exit For Next cll If AllBlank Then rw.Hidden = True Next rw End Sub -- p45cal "johan" wrote: Hello, Somebody can help me with below question ?. I have a sheet with always visible the columns A and B. From the other columns (C till the last used column) some columns (each time different ones) are hidden. In the visible columns some of the records shows registrated data. I need some help for a macro that hide all the rows of the "at that moment visible columns" that contains no registrated data in all the visible columns in the same row. For example,... visible columns: D E H row 3: x x row 4: row 5: x x row 6: x row 7: row 8: x The macro should hide the rows 4 and 7 because the visible columns at that moment shows no registrated data in each record of that specific row (in the shown columns from C till the last used). Regards and waiting for the solution, thanks. Johan |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Works fine. Thanks.
|
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Want to Hide columns in spreadsheet but NOT hide data in chart. | Charts and Charting in Excel | |||
Deleting rows in two columns with a code in visual basic | Excel Discussion (Misc queries) | |||
Trying to hide all rows where no data is in columns AQ-AV | Excel Programming | |||
Can visual basics hide rows based on cell values? | Excel Discussion (Misc queries) | |||
Hide Rows and Columns | Excel Programming |