Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Update Pivot page field from a cell entry

Please find below a code which I recieved from this discussion forum and used
with Excel 2003. This code is used to update a pivot page field by entering
required value in a particular cell (Cell F4 in the below code) and double
click on it. This code is working perfect with Excel 2003 but when I convert
the same file into Excel 2007 and try to use it, I get debug screen pointed
to the line - SubNum.CurrentPage = Pi.Value.

Can someone help with this issue and make this code work under Excel 2007.
Thanks in advance.. Santhosh
--------------------------------------------
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)

Dim SubNum As PivotField

If Target.Count 1 Then Exit Sub
If IsEmpty(Target.Value) Then Exit Sub
If Target.Address = "$F$4" Then
Worksheets("StmtData").PivotTables("PivotTable1"). PivotCache.Refresh
Set SubNum = Worksheets("StmtData").PivotTables _
("PivotTable1").PageFields( _
"SubNo")

For Each Pi In SubNum.PivotItems
If Pi.Value = Target.Text Then
SubNum.CurrentPage = Pi.Value
Exit For
End If
Next
End If

Worksheets("StmtUSD").PivotTables("PivotTable2").P ivotCache.Refresh


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
Pivot Table Page Field value from cell in another worksheet kernel Excel Discussion (Misc queries) 3 May 26th 10 05:54 PM
Excel Pivot Table link page field to spreadsheet cell excel misc Excel Discussion (Misc queries) 1 March 21st 07 11:18 PM
Not all Filters made on Page Field Variables Update the Data ThereIs Excel Worksheet Functions 0 August 23rd 06 11:07 AM
PIVOT LEARNER - Field Entry billy_bags Excel Worksheet Functions 1 July 19th 06 01:22 PM
Pivot Table Page field link to cell Santhosh Mani Excel Worksheet Functions 0 May 12th 05 05:58 AM


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