Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I have a number of worksheets with Pivot Tables on them. I also have a list of Rowfields. Lets say the worksheets are called Sheet1, Sheet2 etc and the RowFields are called Field1, Field 2 etc. I'm trying to create a list on a control sheet (CONTROL) with the following layout: Sheet Field Exists Sheet1 Field1 Yes Sheet1 Field 2 No Sheet2 Field 1 Yes Sheet2 Field 2 Yes ............................ ............................. And so on..... -- Andrew |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Hi Assuming that your sheet names are on Control, starting in A2 then try Code: -------------------- Sub bbb() With Sheets("Control") For Each ce In .Range("A2:A" & .Cells(Rows.Count, 1).End(xlUp).Row) On Error Resume Next Set xx = Nothing Set xx = Sheets(ce.Value).PivotTables(1).RowFields(ce.Offse t(0, 1).Value) If xx Is Nothing Then ce.Offset(0, 2).Value = "NO" Else ce.Offset(0, 2).Value = "YES" End If Next ce End With End Sub -------------------- rylo -- rylo ------------------------------------------------------------------------ rylo's Profile: http://www.thecodecage.com/forumz/member.php?userid=28 View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=28930 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks rylo,
Didn't work 1st time - I'll work thru it overnight Thank -- Andrew "rylo" wrote: Hi Assuming that your sheet names are on Control, starting in A2 then try Code: -------------------- Sub bbb() With Sheets("Control") For Each ce In .Range("A2:A" & .Cells(Rows.Count, 1).End(xlUp).Row) On Error Resume Next Set xx = Nothing Set xx = Sheets(ce.Value).PivotTables(1).RowFields(ce.Offse t(0, 1).Value) If xx Is Nothing Then ce.Offset(0, 2).Value = "NO" Else ce.Offset(0, 2).Value = "YES" End If Next ce End With End Sub -------------------- rylo -- rylo ------------------------------------------------------------------------ rylo's Profile: http://www.thecodecage.com/forumz/member.php?userid=28 View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=28930 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Hi Try the attachment. rylo +-------------------------------------------------------------------+ |Filename: andrew.zip | |Download: http://www.thecodecage.com/attachment.php?attachmentid=12| +-------------------------------------------------------------------+ -- rylo ------------------------------------------------------------------------ rylo's Profile: http://www.thecodecage.com/forumz/member.php?userid=28 View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=28930 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Is there a formula that exists... | Excel Discussion (Misc queries) | |||
Using NOT Exists in SQL | Excel Programming | |||
Run macro <iif</i 001.xls exists | Excel Programming | |||
Exists? | Excel Programming | |||
Hide subtotals of rowfields in a pivot table | Excel Programming |