Excel 2007 table named range does not include headers

G

greg

with excel 2003, I used to import tables, and then use the imported query
'range name' to do further analysis of the data using (dsum, dcount, ...)

eg.

result =
Application.WorksheetFunction.DCount(Range("sheet1!query_range_name"), "age",
Range("sheet2!criteria_range_name"))

with excel 2007, the data can now only be imported as a 'table', and the
table 'range name' does not include it's headers, so the above code fails

Have also tried using the 'External Data Properties name' (which is the
range name that used to work in 2003) but this is not recognised either.

I know a possible work around is to create a new range name which includes
the headers and change it each time the table refreshes - but surely there
must be a method without this annoying workaround??
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top