Help with code...

Atomsk

Registered User.
Local time
Today, 09:48
Joined
Jun 14, 2003
Messages
13
MsgBox PivotTable5.ActiveData.Cells.DetailCells(0,0).Value

Gives an error when I run?
 
What is the Error?

You can concentrate your efforts on this part of the code:

PivotTable5.ActiveData.Cells.DetailCells(0,0).Value
 
"Wrong number of arguments, or invalid property assignment:
'PivotTable5.ActiveData.Cells'"

Supposedly the following is the correct code in VBA, I'm just trying to figure it out for VBS:


Dim CellValue
Dim ActView As PivotView
Dim fldSets As PivotFieldSets
Dim Sel As PivotDetailRange
Dim RowNum As Long
Dim pvDetCell As PivotDetailCell
Dim PvCell As PivotCell

Set ActView = PvTable.ActiveView
Set fldSets = ActView.FieldSets
Set Sel = PvTable.selection
Set pvDetCell = Sel.BottomRight
RowNum = pvDetCell.Row

With PvTable.ActiveData
Set PvCell = .cells(.RowMembers(0), .ColumnMembers(0))
End With
CellValue = PvCell.DetailCells(RowNum, 4).value
 

Users who are viewing this thread

Back
Top Bottom