98.7% Of all customers recommend us, we're so confident about our results we publish all reviews and stats
View Live Stats View ReviewsForum home » Delegate support and help forum » Microsoft Excel VBA Training and help » Pivot tables in VBA
Pivot tables in VBA
Resolved · Low Priority · Version 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 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
Any suggestions, questions or comments? Please post in the Improve the forum thread. |
Excel tip:Multiple Lines of Text in a CellAs an alternative to the Text Wrapping facility, type a word or two, press Alt+Enter to get a new line, type more text, and continue the process for as many lines as you need. Enter as normal when you have finished. |