View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
FSt1 FSt1 is offline
external usenet poster
 
Posts: 3,942
Default Add rows after hiding rows

hi
since you didn't post any code, i can only guess and assume that your
project is code and that you are going down a list in a loop to hide the zero
rows.

dim c as long
c=c+1 'add this just after the line that hides the zero row

you could add a counter to count the number of rows that are hidden.
then after your loop, you can add the count of hidden rows back in.
Range("A1").End(xlDown).Offset(1, 0).Select 'go to end of data
For i = 1 To c
ActiveCell.EntireRow.Insert shift:=xlDown
Next i

my thoughts
Regards
FSt1

"eshoobee1" wrote:

I have a project that hides a row in the print area when a specified column
in that row equals zero. The number of hidden rows varies depending on user
input. I need a way to add the same number of blank rows at the end of the
list of printed rows so that the size of my print area does not change. An
suggestions?