Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 358
Default Does Rowfields exists?

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Does Rowfields exists?


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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 358
Default Does Rowfields exists?

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Does Rowfields exists?


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
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
Is there a formula that exists... Isaac Excel Discussion (Misc queries) 3 May 24th 08 02:36 PM
Using NOT Exists in SQL [email protected] Excel Programming 2 November 20th 06 07:28 PM
Run macro <iif</i 001.xls exists okanem[_3_] Excel Programming 3 May 31st 06 08:41 AM
Exists? Tom Excel Programming 3 March 9th 05 10:43 AM
Hide subtotals of rowfields in a pivot table Huyeote[_2_] Excel Programming 3 April 22nd 04 04:46 AM


All times are GMT +1. The time now is 11:49 PM.

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

About Us

"It's about Microsoft Excel"