Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default How do you hide multiple row macro

Hi,

I'm trying to write a macro that will hide a row if the cells in column "g"
through to "r" are blank.

Can anyone help?

Thanks
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default How do you hide multiple row macro

Mat,

This should do what you want.

Sub stance()
Dim MyRange
Dim copyrange As Range
LastRow = Cells.SpecialCells(xlLastCell).Row
Set MyRange = Range("G1:G" & LastRow)
For Each c In MyRange
If WorksheetFunction.CountA(c.Resize(, 12)) = 0 Then
If copyrange Is Nothing Then
Set copyrange = c
Else
Set copyrange = Union(copyrange, c)
End If
End If
Next
If Not copyrange Is Nothing Then
copyrange.EntireRow.Hidden = True
End If
End Sub


Mike

"Matt" wrote:

Hi,

I'm trying to write a macro that will hide a row if the cells in column "g"
through to "r" are blank.

Can anyone help?

Thanks

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 to hide sheets EricBB Excel Discussion (Misc queries) 5 August 10th 09 07:49 PM
Macro to hide rows lightbulb Excel Discussion (Misc queries) 4 July 11th 08 06:13 PM
Hide a Macro [email protected] Excel Discussion (Misc queries) 2 July 26th 07 09:12 AM
macro to hide row with 0.00 Lori Excel Worksheet Functions 2 April 25th 07 08:56 PM
macro to hide rows david Excel Discussion (Misc queries) 3 April 8th 05 03:25 PM


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