Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Trying to set a pivot field to a subset of values listed in range of cells

I am trying to create a macro that when run will deselect non matching
values in a pivot field. I want the macro to look at a range I have in
another sheet and deselect the values that do not match in the pivot
field and cell range. The code is below. I know the error lies in my
"not equal" comparison of the pivotfield to my cell range, but I do not
know how to fix it. I also have the cell range "L2:L63" named
"MDS_MIX", but also could not get that reference to work. Thanks for
the help.

Public Sub 24_MIX_Click()
On Error GoTo X
Application.ScreenUpdating = False

Dim MyMDS As Variant
Dim MyValue As Variant
Dim MyArray() As Variant
Dim MyList() As Variant

MyList = Sheets("Converters").Range("L2:L63")
MyValue = Sheets("Converters").Range("O1")


For i = 1 To MyValue
If
ActiveSheet.PivotTables("PivotTable1").PivotFields ("MDS").PivotItems(i).Value
< MyList Then

ActiveSheet.PivotTables("PivotTable1").PivotFields ("MDS").PivotItems(i).Visible
= False
End If
Next i

Application.ScreenUpdating = True

X:
AddAll_MDS_Click
Application.ScreenUpdating = True
End Sub

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Missing values from a pivot table field Kelli[_2_] Excel Worksheet Functions 1 April 27th 10 07:44 PM
Pivot Table Field Values not sorted pepperds Excel Discussion (Misc queries) 1 February 16th 07 08:16 PM
Assigning values to Pivot field cmungall Excel Programming 1 June 2nd 06 02:26 PM
Delete Rows if Certain Values are listed in a Range Name John Excel Programming 6 June 27th 04 10:59 PM
DeSelect certain values in row pivot field Todd Huttenstine Excel Programming 0 May 20th 04 05:01 PM


All times are GMT +1. The time now is 06:42 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"