Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

pivot tables vba

Forum home » Delegate support and help forum » Microsoft Excel VBA Training and help » Pivot tables in VBA

Pivot tables in VBA

ResolvedVersion 2003

Grant has attended:
Excel VBA Intro Intermediate course
Excel VBA Intro Intermediate course

Pivot tables in VBA

When working the VBA pivot examples with Carlos we discovered that the code we used to select the underlying database broke down when there were gaps in the data in the rightmost column i.e. it would no longer select the full database, stopping at the row with the gap. I would be grateful for an answer on how to adjust the code to select the full dataset even if there was a hole (empty cells) in the data. Thank you!

RE: pivot tables in VBA

Hi Grant

Since in most data tables the first cell has always got data in it by using CurrentRegion you can select the whole table even if some cells in the first and last columns are blank

Set DataRange = Range("A9").CurrentRegion


Hope this helps

Carlos

 

Training courses

Training information:

Welcome. Please choose your application (eg. Excel) and then post your question.

Our Microsoft Qualified trainers will then respond within 24 hours (working days).

Frequently Asked Questions
What does 'Resolved' mean?

Any suggestions, questions or comments? Please post in the Improve the forum thread.

Excel tip:

Concatenating Results of Formulas

To concatenate the results of formulas simply add the "&" after the formula or function closing bracket.

function1(....)&function2(.....)

see example Creating a range of monthly payments as text.

View all Excel hints and tips

Connect with us:

0207 987 3777

Call for assistance

Request Callback

We will call you back

Server loaded in 0.09 secs.