LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 125
Default Hide row if particular cells are empty

Many thanks Martin and Tom - I have used Martn's solution because I
understand the construction whereas Tom's is a bit beyond my simple VBA
abilities.

My rate for this reply?

It is the same as always - I am amazed at the speed and quality of the
replies and very grateful for your dedication to helping us.

Francis Hookham


"Martin Fishlock" wrote in message
...
Hi Francis,

Try this little macro.

Option Explicit

Sub hiderowson4567()

Dim lLastRow As Long, lRow As Long

With ActiveSheet

lLastRow = .UsedRange.Row + .UsedRange.Rows.Count - 1
For lRow = 1 To lLastRow
If IsEmpty(.Cells(lRow, 4)) Then
If IsEmpty(.Cells(lRow, 5)) Then
If IsEmpty(.Cells(lRow, 6)) Then
If IsEmpty(.Cells(lRow, 7)) Then
.Rows(lRow).Hidden = True
End If
End If
End If
End If
Next lRow

End With
End Sub

--
Hope this helps
Martin Fishlock, Bangkok, Thailand
Please do not forget to rate this reply.


"Francis Hookham" wrote:

Text can be in none, any or all of the cells of columns 4, 5, 6 and 7 in
each row.



I need to hide the row only if all cells 4, 5, 6 and 7 are empty but
leave
the row visible if any cell includes text.



I just cannot see how to do it - everything else is ok - determining the
number of rows which vary and progressing from row to row - it is just
the
test in each row I need help with.



Best wishes for 2007 - another hour to go here in the UK.



Francis Hookham





 
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
macro to colour empty cells (cells not recognized as empty) Gerben Excel Programming 5 June 30th 05 03:29 PM
Macro to hide rows with empty cells tp58tp Excel Worksheet Functions 2 November 13th 04 02:01 PM
Hide row with empty cells Trevor Shuttleworth Excel Programming 0 September 26th 03 10:13 PM
Hide row with empty cells Don Guillett[_4_] Excel Programming 0 September 26th 03 06:36 PM
Can blank cells created using empty Double-Quotes not be empty?? JohnI in Brisbane Excel Programming 6 September 7th 03 11:22 PM


All times are GMT +1. The time now is 07:25 AM.

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"