Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default hiding blank rows

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 538
Default hiding blank rows

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default hiding blank rows

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 538
Default hiding blank rows

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Hiding Rows with Blank cells GoBucks[_2_] Excel Programming 4 June 10th 09 03:50 PM
Hiding Blank Rows in a Range Matthew[_2_] Excel Programming 0 July 19th 07 07:52 PM
Hiding blank rows pkeegs Excel Programming 1 March 1st 06 04:15 AM
Hiding Rows if the linked rows are blank KG Excel Discussion (Misc queries) 9 May 18th 05 02:32 AM
Hiding blank rows mlkpied Excel Discussion (Misc queries) 1 March 29th 05 08:57 PM


All times are GMT +1. The time now is 11:21 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"