Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
looking for code that will search for data in column F,I,L and O from rows 2 through 138. If there is data in one or more cells in a specific row then i don't want to hide it but if all cells in a specific row are blank then i want to hide the row. Is this possible. thanks in advance. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
kijijijt wrote:
looking for code that will search for data in column F,I,L and O from rows 2 through 138. If there is data in one or more cells in a specific row then i don't want to hide it but if all cells in a specific row are blank then i want to hide the row. Is this possible. thanks in advance. Try this: Sub hideBlanks() Dim blank As Boolean For L0 = 2 To 138 blank = ("" = Cells(L0, 6).Formula) And _ ("" = Cells(L0, 9).Formula) And _ ("" = Cells(L0, 12).Formula) And _ ("" = Cells(L0, 15).Formula) If blank Then Cells(L0, 1).EntireRow.Hidden = True Next End Sub If there is a formula in those cells that sometimes returns a blank, change all instances of ".Formula" to ".Value". (There are other ways to do this, of course.) -- Why can't you see the funny side? Why aren't you laughing? |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Saturday, January 19, 2013 10:07:46 PM UTC-5, Auric__ wrote:
kijijijt wrote: looking for code that will search for data in column F,I,L and O from rows 2 through 138. If there is data in one or more cells in a specific row then i don't want to hide it but if all cells in a specific row are blank then i want to hide the row. Is this possible. thanks in advance. Try this: Sub hideBlanks() Dim blank As Boolean For L0 = 2 To 138 blank = ("" = Cells(L0, 6).Formula) And _ ("" = Cells(L0, 9).Formula) And _ ("" = Cells(L0, 12).Formula) And _ ("" = Cells(L0, 15).Formula) If blank Then Cells(L0, 1).EntireRow.Hidden = True Next End Sub If there is a formula in those cells that sometimes returns a blank, change all instances of ".Formula" to ".Value". (There are other ways to do this, of course.) -- Why can't you see the funny side? Why aren't you laughing? works great, thanks. |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
wrote:
On Saturday, January 19, 2013 10:07:46 PM UTC-5, Auric__ wrote: kijijijt wrote: looking for code that will search for data in column F,I,L and O from rows 2 through 138. If there is data in one or more cells in a specific row then i don't want to hide it but if all cells in a specific row are blank then i want to hide the row. Is this possible. thanks in advance. Try this: Sub hideBlanks() Dim blank As Boolean For L0 = 2 To 138 blank = ("" = Cells(L0, 6).Formula) And _ ("" = Cells(L0, 9).Formula) And _ ("" = Cells(L0, 12).Formula) And _ ("" = Cells(L0, 15).Formula) If blank Then Cells(L0, 1).EntireRow.Hidden = True Next End Sub If there is a formula in those cells that sometimes returns a blank, change all instances of ".Formula" to ".Value". (There are other ways to do this, of course.) -- Why can't you see the funny side? Why aren't you laughing? works great, thanks. I swear to god, I'm going to hunt down whoever it is at Google who decided that double-spacing EVERYTHING was a good idea! Argh! -- We share the same biology, regardless of ideology. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Hiding Rows with Blank cells | Excel Programming | |||
Hiding Blank Rows in a Range | Excel Programming | |||
Hiding blank rows | Excel Programming | |||
Hiding Rows if the linked rows are blank | Excel Discussion (Misc queries) | |||
Hiding blank rows | Excel Discussion (Misc queries) |