#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 336
Default Hide Rows

Hi,

Here is my code:

Set myrange = Range("A18:A1220")
For Each c In myrange
If Value = Empty Then c.Row.Hidden = True
Next

What I am trying to do is check the value on cells A18 to A1220 and if they
are blank or empty then hide the entire row. However I get an error message
saying the object is required.

Can anyone point me in the right direction?

Many thanks,

Martin
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,420
Default Hide Rows

Set myrange = Range("A18:A1220")
For Each c In myrange
If c.Value = "" Then c.Entirerow.Hidden = True
Next


--
__________________________________
HTH

Bob

"Martin" wrote in message
...
Hi,

Here is my code:

Set myrange = Range("A18:A1220")
For Each c In myrange
If Value = Empty Then c.Row.Hidden = True
Next

What I am trying to do is check the value on cells A18 to A1220 and if
they
are blank or empty then hide the entire row. However I get an error
message
saying the object is required.

Can anyone point me in the right direction?

Many thanks,

Martin



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default Hide Rows

Martin,

Try

Sub sonic()
Set myrange = Range("A18:A1220")
For Each c In myrange
If IsEmpty(c) Then c.EntireRow.Hidden = True
Next
End Sub

Mike

"Martin" wrote:

Hi,

Here is my code:

Set myrange = Range("A18:A1220")
For Each c In myrange
If Value = Empty Then c.Row.Hidden = True
Next

What I am trying to do is check the value on cells A18 to A1220 and if they
are blank or empty then hide the entire row. However I get an error message
saying the object is required.

Can anyone point me in the right direction?

Many thanks,

Martin

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 336
Default Hide Rows

Thank you both for your help, it is much appreciated.

Martin

"Mike H" wrote:

Martin,

Try

Sub sonic()
Set myrange = Range("A18:A1220")
For Each c In myrange
If IsEmpty(c) Then c.EntireRow.Hidden = True
Next
End Sub

Mike

"Martin" wrote:

Hi,

Here is my code:

Set myrange = Range("A18:A1220")
For Each c In myrange
If Value = Empty Then c.Row.Hidden = True
Next

What I am trying to do is check the value on cells A18 to A1220 and if they
are blank or empty then hide the entire row. However I get an error message
saying the object is required.

Can anyone point me in the right direction?

Many thanks,

Martin

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
Macro code to hide rows and not calculate hidden rows bradmcq Excel Discussion (Misc queries) 0 September 1st 09 12:38 AM
Enabling option „Format rows“ to hide/unhide rows using VBA-code? ran58 Excel Discussion (Misc queries) 0 July 28th 09 03:46 PM
Code for Excel 2007 to hide rows based on sum of several rows not ina range Joe Gardill Excel Programming 2 August 29th 08 03:53 PM
hide multiple rows based on condition within rows Skymann Excel Programming 6 October 21st 07 04:01 PM
Specify which rows to NOT hide, and have excel hide the rest Mo2 Excel Programming 0 April 25th 07 03:44 AM


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

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

About Us

"It's about Microsoft Excel"