Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default loop hide cells

I tried this yesterday and got answers which, unfortunately, did not satisfy
my need. Thank you for your help, though. Let me try and explain a little
better.
I am trying to create a loop, where as many rows as I want will hide if, for
example, column b in the row above is empty. this is my code for one line.
Dim rng As Range
Set rng = Me.Range("b142:b186")
If Not Intersect(rng, Target) Is Nothing Then
Rows(143).EntireRow.Hidden = IsEmpty(rng.Value)
End If
I am thinking that I need a variable and a +1 or a -1 for each row, but can
not come up with anything. Anyone?
Thanks again for your help yesterday.
Darren
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,049
Default loop hide cells

i thought that I'd replied.beg pardon...
try this:

dim cell as range
for each cell in range("B142:B186").Cells
if cell.Value = "" then Rows(Cell.row).EntireRow.Hidden = True
next

"DarrenL" wrote in message
...
I tried this yesterday and got answers which, unfortunately, did not
satisfy
my need. Thank you for your help, though. Let me try and explain a
little
better.
I am trying to create a loop, where as many rows as I want will hide if,
for
example, column b in the row above is empty. this is my code for one line.
Dim rng As Range
Set rng = Me.Range("b142:b186")
If Not Intersect(rng, Target) Is Nothing Then
Rows(143).EntireRow.Hidden = IsEmpty(rng.Value)
End If
I am thinking that I need a variable and a +1 or a -1 for each row, but
can
not come up with anything. Anyone?
Thanks again for your help yesterday.
Darren


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default loop hide cells

That's kind of what I have, except I need it to hide a row below the cell
that I am referencing......any thoughts?

"Patrick Molloy" wrote:

i thought that I'd replied.beg pardon...
try this:

dim cell as range
for each cell in range("B142:B186").Cells
if cell.Value = "" then Rows(Cell.row).EntireRow.Hidden = True
next

"DarrenL" wrote in message
...
I tried this yesterday and got answers which, unfortunately, did not
satisfy
my need. Thank you for your help, though. Let me try and explain a
little
better.
I am trying to create a loop, where as many rows as I want will hide if,
for
example, column b in the row above is empty. this is my code for one line.
Dim rng As Range
Set rng = Me.Range("b142:b186")
If Not Intersect(rng, Target) Is Nothing Then
Rows(143).EntireRow.Hidden = IsEmpty(rng.Value)
End If
I am thinking that I need a variable and a +1 or a -1 for each row, but
can
not come up with anything. Anyone?
Thanks again for your help yesterday.
Darren


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default loop hide cells

Well, in that case it seems to me that this line should do the trick:

if cell.Value = "" then Rows(Cell.row+1).EntireRow.Hidden = True


"DarrenL" wrote:

That's kind of what I have, except I need it to hide a row below the cell
that I am referencing......any thoughts?

"Patrick Molloy" wrote:

i thought that I'd replied.beg pardon...
try this:

dim cell as range
for each cell in range("B142:B186").Cells
if cell.Value = "" then Rows(Cell.row).EntireRow.Hidden = True
next

"DarrenL" wrote in message
...
I tried this yesterday and got answers which, unfortunately, did not
satisfy
my need. Thank you for your help, though. Let me try and explain a
little
better.
I am trying to create a loop, where as many rows as I want will hide if,
for
example, column b in the row above is empty. this is my code for one line.
Dim rng As Range
Set rng = Me.Range("b142:b186")
If Not Intersect(rng, Target) Is Nothing Then
Rows(143).EntireRow.Hidden = IsEmpty(rng.Value)
End If
I am thinking that I need a variable and a +1 or a -1 for each row, but
can
not come up with anything. Anyone?
Thanks again for your help yesterday.
Darren




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
Slow VBA code....Hide/Unhide Loop Tami Excel Worksheet Functions 2 August 4th 09 01:53 AM
Adding up range of cells exclude hide cells Len Excel Programming 5 May 26th 08 02:36 PM
Want to show/hide cells depending on other cells results Marco Excel Discussion (Misc queries) 0 August 15th 06 06:21 PM
Hide row loop johncassell[_21_] Excel Programming 4 August 9th 05 04:01 PM
How do I create an IF function to hide cells in column B IF cells. nlw2 Excel Programming 0 October 25th 04 06:39 PM


All times are GMT +1. The time now is 09:26 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"