Hide Cells

  • Thread starter Thread starter Janet
  • Start date Start date
J

Janet

I want to create a macro which finds the last cell with
data and hides all subsuequent rows up to A600 where the
totals show.

Range("A600").Select
Selection.End(xlUp).Select

How do I hide from this last cell to row 600 within the
macro.
 
Janet,

Is this what you mean?

Range("A600:A" & Cells(Rows.Count, "A").End(xlUp).Row).EntireRow.Hidden
= True

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
When I run this, the first time I invoke the macro nothing
happens. When I try it a second time, it hides two of the
rows with data and hides up to row 602 which also hides
the totals.

Can you explain to me what you have written and from there
I may be able to figure it out. Thanks in advance for all
your help
 
Janet,

I had assumed that your start point was beyond row 600, but this seems to
suggest otherwise. Thus, can you try this instead

Range("A" & Range("A1").End(xlDown).Row + 1 & ":A599").EntireRow.Hidden
= True


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
Back
Top