Hi All,
I am writing a macro to allow a user to select a date range in a OLAP pivot table by simply entering the begin and end dates in the worksheet. From the code snippet below, you can see that the [Time] dimension has a hierarchical structure. The arrays in the statements are built elsewhere in the macro based on input dates. The code works well for the most part, but in certain settings it runs into an issue. Here is an example. Assume a user selected the month of 01/2011 at one time and wants to select 2/1/2011 now. The code would get stuck at the month statement. I have found some clues as to why this occurs, but don't know how it can be fixed. Basically, you must have something selected in a filter. The year, quarter statements run okay because 01/2011 is selected, but the month statement gets into trouble because once 01/2011 is gone, nothing is selected any more. Any ideas/insights?
Bookmarks