overload955
New Member
- Joined
- Oct 17, 2013
- Messages
- 1
Hi guys. I have a problem and I'm dealing with it for a couple of days already.
I have a pivot table that is made from 4 Row Labels. I'm trying to sort the data from this pivot table based on the data I have in a column called "In Analysis Date". My dropdown list looks like this:
I'm trying to check only the boxes from a certain month and year. I'm ussing the following piece of code for doing that:
This code works well except the fact that it won't check, for example, the second 10/2/2013 10:08. I don't know why this happens. Basically excel sees that item as being checked but in reality only the first one is checked. This happens for all values that are duplicated. I really don't know how to solve this. An advice from you guys will help me a lot.
Thanks in advance.
I have a pivot table that is made from 4 Row Labels. I'm trying to sort the data from this pivot table based on the data I have in a column called "In Analysis Date". My dropdown list looks like this:
I'm trying to check only the boxes from a certain month and year. I'm ussing the following piece of code for doing that:
Code:
For j = 1 To 400
dt = CDate(pvt.RowFields(2).PivotItems(j).Name)
If month(dt) = m And Year(dt) = y Then
If pvt.RowFields(2).PivotItems(j).Visible = False Then
pvt.RowFields(2).PivotItems(j).Visible = True
End If
End If
Next j
This code works well except the fact that it won't check, for example, the second 10/2/2013 10:08. I don't know why this happens. Basically excel sees that item as being checked but in reality only the first one is checked. This happens for all values that are duplicated. I really don't know how to solve this. An advice from you guys will help me a lot.
Thanks in advance.