According to VBA Help, RANGE has to be in A1 style
notation. Yours is R1C1.
Cheers, Pete.
-----Original Message-----
I have a macro I recorded and am now trying to tweek with
VBA to make it
more accurate. In the recorder I got the pivot source
from naming a
large cell range, some of which I don't need.
Trying to make the source dynamic but first was just
trying to "name"
the range for the source data to pull from. Here's the
pivot
generation statement:
ActiveWorkbook.PivotCaches.Add(SourceType:=xlData base,
SourceData:=
"R2C1:R2800C26").CreatePivotTable _
TableDestination:="", TableName:="PivotTable4"
Trying to name a range to replace "R2C1:R2816C26", but
get an error
code when it runs. Below is the code to set the range
name.
Dim RawData As Range
Set RawData = Range("R2C1:R2800C26")
Get "error 1004, Method 'Range' of object '_Global failed"
What am I doing wrong? TIA Lift Off
---
Message posted from http://www.ExcelForum.com/
.