Hi
However you are defining your dynamic range, make the row count element
the maximum of 1 and rowcount.
something like
=OFFSET($A$1,0,0,MAX(2,COUNTA($A:$A)),12)
You have to have a header in row 1, hence COUNTA is bound to return 1,
so just force it to be 2 if there is just the single header line.

Signature
Regards
Roger Govier
> Hi All,
>
[quoted text clipped - 24 lines]
> Thanks!
> Kris
k.vanderstarren@gmail.com - 20 Jan 2006 13:16 GMT
Thank you very much Roger ... that worked like a charm! :)
k.vanderstarren@gmail.com - 20 Jan 2006 13:55 GMT
Oooops, spoke too soon. The solution worked in the sense that it
produced a blank PivotTable without generating an error but it caused a
problem with a date column in the PivotTable that's being grouped.
The PivotTable contains a date column that's grouped by Year and Month.
Refreshing with a blank data source destroyed this grouping. My guess
is that this is because you cannot grouping a column with blank rows.
Any ideas?
Thanks,
Kris
Roger Govier - 20 Jan 2006 14:25 GMT
Hi Kris
Since you say you are running macros, could you not just ensure that
there is a single "row" of data by just writing a date to cell A2 of
the data sheet e.g. A2=TODAY()
Then, the count will still include just one "blank" row of data as well
as the headers, but the grouping will work because there will be a valid
date in row 1. It will not affect any future PT reports as all other
values in that row would be null.

Signature
Regards
Roger Govier
> Oooops, spoke too soon. The solution worked in the sense that it
> produced a blank PivotTable without generating an error but it caused
[quoted text clipped - 10 lines]
> Thanks,
> Kris
k.vanderstarren@gmail.com - 23 Jan 2006 17:42 GMT
Thanks again for the responses Roger - your suggestions were a big
help. The way I ended up solving the problem was to create two rows in
the source data that contained only the year and month and I used these
two columns in my pivot table rather than the original date column that
I was using. This approach allowed the PivotTable to automatically
group by year and month without having to define a custom grouping.
Sincerely,
Kris