Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Show only matches between a named cell range and the values in a page field - vba

I'm trying to create a macro in vba that will compare a list of items
in a named cell range to the values in a page field of a pivot table.
The named cell range is a subset of the complete list of values in the
page field of the pivot table. I want to hit a button and the pivot
table will automatically select only the subset of values. Any ideas?

I tried this, but the comparison between the pivot item value and the
array is obviuously not working.

Public Sub A4_24_MIX_Click()
Dim MyValue As Variant
Dim MyArray() As Variant

MyValue = Sheets("Converters").Range("O1")
'i'm not even sure how to reference a named cell range - the cells
named range is "A4_MIX" and are cells L2:L63
MyArray = ActiveWorkbook.Range(A4_MIX)


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

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

End Sub

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Show only matches between a named cell range and the values in a page field - vba

anything? any ideas?

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
Macro to Show (and Print) Only Named Range? Pausert Excel Discussion (Misc queries) 1 October 25th 10 06:09 PM
How do I only pull rows if the data matches a named range? Aneske Excel Worksheet Functions 0 July 17th 08 04:05 PM
Show field or range name in a cell Michael Excel Dude Excel Discussion (Misc queries) 1 September 8th 06 02:52 AM
formula for named cell/range using cell values alex Excel Worksheet Functions 2 August 27th 05 06:44 PM
formula for named cell/range based on cell values alex Excel Programming 2 August 25th 05 02:50 PM


All times are GMT +1. The time now is 03:58 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"