Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi,
I'm trying to write a macro that will hide a row if the cells in column "g" through to "r" are blank. Can anyone help? Thanks |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Mat,
This should do what you want. Sub stance() Dim MyRange Dim copyrange As Range LastRow = Cells.SpecialCells(xlLastCell).Row Set MyRange = Range("G1:G" & LastRow) For Each c In MyRange If WorksheetFunction.CountA(c.Resize(, 12)) = 0 Then If copyrange Is Nothing Then Set copyrange = c Else Set copyrange = Union(copyrange, c) End If End If Next If Not copyrange Is Nothing Then copyrange.EntireRow.Hidden = True End If End Sub Mike "Matt" wrote: Hi, I'm trying to write a macro that will hide a row if the cells in column "g" through to "r" are blank. Can anyone help? Thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
macro to hide sheets | Excel Discussion (Misc queries) | |||
Macro to hide rows | Excel Discussion (Misc queries) | |||
Hide a Macro | Excel Discussion (Misc queries) | |||
macro to hide row with 0.00 | Excel Worksheet Functions | |||
macro to hide rows | Excel Discussion (Misc queries) |