PC Review


Reply
Thread Tools Rate Thread

Dynamic Data Range from External Text File, Filter

 
 
Chad Richardson
Guest
Posts: n/a
 
      14th Apr 2007
Several issues I'm hoping some smarty pants can help with

I am importing data from a text file that the user will refresh on open.
There are 5 columns to the right of the imported data used for calculated
fields.

There are several tabs that have pivot tables that use the dynamic imported
data on the first tab as its source.

Question 1:
How to have the pivot tables reference a range that will grow/shrink based
on the nbr of rows in the refreshed data AND include the added calculated
columns. I know you can use the Query name as the pivot table source, but it
will not include those 5 calculated columns. Or I can create a name range
that includes the 5 columns, but will not shrink/grow with the refreshed
data. I need to combine the 2 methods somehow....

Question 2:
How can I filter the text data so certain rows are not included in the pivot
table? (I am using average summations and I want to throw out rows that have
zeros for values as there are many and skew the averages incorrectly).

Thanks in advance!
Chad


 
Reply With Quote
 
 
 
 
Debra Dalgleish
Guest
Posts: n/a
 
      14th Apr 2007
You can use an offset from the query name to create a dynamic range, e.g.:

=OFFSET(QueryName,,,,COUNTA(Sheet1!$1:$1))

Chad Richardson wrote:
> Several issues I'm hoping some smarty pants can help with
>
> I am importing data from a text file that the user will refresh on open.
> There are 5 columns to the right of the imported data used for calculated
> fields.
>
> There are several tabs that have pivot tables that use the dynamic imported
> data on the first tab as its source.
>
> Question 1:
> How to have the pivot tables reference a range that will grow/shrink based
> on the nbr of rows in the refreshed data AND include the added calculated
> columns. I know you can use the Query name as the pivot table source, but it
> will not include those 5 calculated columns. Or I can create a name range
> that includes the 5 columns, but will not shrink/grow with the refreshed
> data. I need to combine the 2 methods somehow....
>
> Question 2:
> How can I filter the text data so certain rows are not included in the pivot
> table? (I am using average summations and I want to throw out rows that have
> zeros for values as there are many and skew the averages incorrectly).
>
> Thanks in advance!
> Chad
>
>



--
Debra Dalgleish
Contextures
http://www.contextures.com/tiptech.html

 
Reply With Quote
 
Mike Fogleman
Guest
Posts: n/a
 
      14th Apr 2007
I use the named range method. The PT source is the range name. Upon adding
new data to the source, I then re-size the named range.

Dim DRow As Long
Dim DRng As Range

DRow = Worksheets("Data").Cells(Rows.Count, "A").End(xlUp).Row
Set DRng = Worksheets("Data").Range("A1:G" & DRow)
ws.Names("Database").RefersTo = "=" & DRng.Address(1, 1, xlA1, True)

Hope this helps some
Mike F

"Chad Richardson" <chad@NIX_SPAM_ChadRichardson.com> wrote in message
news:O$(E-Mail Removed)...
> Several issues I'm hoping some smarty pants can help with
>
> I am importing data from a text file that the user will refresh on open.
> There are 5 columns to the right of the imported data used for calculated
> fields.
>
> There are several tabs that have pivot tables that use the dynamic
> imported data on the first tab as its source.
>
> Question 1:
> How to have the pivot tables reference a range that will grow/shrink based
> on the nbr of rows in the refreshed data AND include the added calculated
> columns. I know you can use the Query name as the pivot table source, but
> it will not include those 5 calculated columns. Or I can create a name
> range that includes the 5 columns, but will not shrink/grow with the
> refreshed data. I need to combine the 2 methods somehow....
>
> Question 2:
> How can I filter the text data so certain rows are not included in the
> pivot table? (I am using average summations and I want to throw out rows
> that have zeros for values as there are many and skew the averages
> incorrectly).
>
> Thanks in advance!
> Chad
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
importing external data from text file erroneously converts text d Dan K Microsoft Access External Data 0 18th Feb 2009 02:26 PM
using advanced filter in VBA with a dynamic range =?Utf-8?B?RGF2ZSBG?= Microsoft Excel Programming 1 2nd Oct 2006 09:19 PM
Advanced Filter to Dynamic Range John Microsoft Excel Programming 5 12th Nov 2005 09:12 PM
copy results of advanced filter to a dynamic range - if only want certain records from the results - filter used to narrow down selection Cheryl Microsoft Excel Discussion 1 20th May 2004 02:19 AM
Dynamic Range from External Reference plano Microsoft Excel Misc 1 25th Jul 2003 01:14 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:17 PM.