View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default macro - hiding rows given a cells content

Sub HideCertainRows()
Dim varr as Variant, i as long, rng as Range
varr = Array("ABC/XYZ", "DEF/STU", "FFF/GGG" )

for i = lbound(varr) to ubound(varr)

set rng = Nothing
set rng = columns(3).Find(varr(i))
if not rng is nothing then
rng.Entirerow.Hidden = True
end if
Next
End Sub

--
Regards,
Tom Ogilvy


"Greg Stevens" wrote in message
...
Hello,

I am seeking some advice on a hiding rows using a macro. The spreadsheet

has
columns A-M and up to 2000 rows. The focus of my question is on column C.

We
have certain headings in column C that only appear once within that column
but when they do we want to automatically hide that row and then go to the
next heading which we have in our macro.

For example, we have heading such as "ABC/XYZ" and "DEF/STU" and "FFF/GGG"
which we would like to be included in the macro and automatically hide the
row when that is contained in row C. But we have many other heading which

we
do not want to hide, or left out of the macro.

Please help me as I have tried writing the string and I was unsuccessful.

thanks

The spreadsheet
--
Greg