Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Pivot Range Name

I have a macro I recorded and am now trying to tweek with VBA to make i
more accurate. In the recorder I got the pivot source from naming
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 pivo
generation statement:

ActiveWorkbook.PivotCaches.Add(SourceType:=xlDatab ase, SourceData:
"R2C1:R2800C26").CreatePivotTable _
TableDestination:="", TableName:="PivotTable4"

Trying to name a range to replace "R2C1:R2816C26", but get an erro
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 Of

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 64
Default Pivot Range Name

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/

.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Pivot Range Name

Pete: I had printed off and marked that line with a hi-liter, but di
not make the connection as recording the macro listed it in relativ
style. Lesson learned! Thanks for taking the time to help me. Lif
Of

--
Message posted from http://www.ExcelForum.com

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
Duplicating Pivot Chart / Changing Pivot Chart data range BillG Excel Discussion (Misc queries) 4 February 25th 10 02:15 PM
Pivot table and value range Nicawette Excel Discussion (Misc queries) 2 December 28th 09 09:09 AM
Edit the range of a pivot table Christine Excel Worksheet Functions 4 October 8th 09 06:31 PM
Pivot Table Range Scott R Excel Worksheet Functions 1 September 27th 07 06:56 AM
Dynamic range in Pivot table Wanna Learn Excel Discussion (Misc queries) 4 July 2nd 07 08:08 PM


All times are GMT +1. The time now is 05:59 AM.

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

About Us

"It's about Microsoft Excel"