Tom has attended:
Excel VBA Intro Intermediate course
Leaving a column out of a report
Hi,
How do you leave a column out of a report, i.e. work with a non-continuous range of data?
Thanks,
Tom
RE: Leaving a column out of a report
Hi Tom, thanks for your query. There are a number of ways to achieve this using the code used on our course. However, all of them involve coding your way round the column you want to leave out.
You could set up two loops, one for before the column you want to leave out, and another for after. Alternatively, you could loop through as normal, but carry out an IF test each iteration, checking for the current index number of the column and if it's the one you want to leave out, simply skip to the next iteration of the loop. This is probably the way I would do it. However, you could set up named ranges for the individual regions and then copy them or code Pivot Tables using only the fields you want. VBA is a flexible tool, your solution just needs to be simple and fit for purpose.
Hope this helps,
Anthony