View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Michael Michael is offline
external usenet poster
 
Posts: 791
Default Hide rows using VBA

Try this:

Sub Hidemyrows()
Dim iLastRow as Integer

iLastRow= Range("A65536").end(xlup).row

For i=1 to iLastRow

If Cells(i,3).value ="Hide" then
Cells(i,3).Entirerow.hidden =true
End If


Next i



End Sub




--
If this posting was helpful, please click on the Yes button.
Regards,

Michael Arch.




"buzzandbeyond" wrote:

Hi,

I am trying to hide rows with a specific value.

In my sheet I have three columns:
Date - The manually inputted date
Today - 1 Month - 'TODAY() -31' (this column will be hidden)
In Range? - an IF statement to say "HIDE" or SHOW" (this column will
be hidden)

I am looking to hide all the rows where Hide shows in the In Range?
column. I would also like this to run on opening the document

Any advice is gratefully received as my vba skills are almost non
existent.

cheers
Dave