LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default macros and pivot tables... help please!


hi all,

i'm in the process of making a macro that will automatically create a
pivot table for me each month. the problem is that the data i work with
each month changes; that is, number of rows of data used for the pivot
table is not always the same. for example, this month i could have 754
rows and 766 rows next month.

i tried using a variable instead of an exact cell number, but excel
seems to be really picky and wants an specific number instead. is it
possible to create a macro for making pivot tables, even if the number
of rows varies on a monthly basis?

here are a few lines from the macro, if it helps:

Range("K2").Select
ActiveWorkbook.PivotCaches.Add(SourceType:=xlDatab ase, SourceData:=
_
"BFCCL!R1C1:R754C9").CreatePivotTable
TableDestination:=Range("K2"), _
TableName:="PivotTable2"

- the worksheet used ("BFCCL"), the starting cell ("R1C1") and the last
column number ("C9") all remain the same per month.
- only the row number ("R754") changes.

i was wondering if anybody out there could help me out with this
problem, as i'm totally stumped. i'd really, really appreciate it.
thanks in advance,

-fred


--
white_rhino
------------------------------------------------------------------------
white_rhino's Profile: http://www.excelforum.com/member.php...o&userid=14552
View this thread: http://www.excelforum.com/showthread...hreadid=261886

 
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
Excel Macros for pivot tables PJS Excel Discussion (Misc queries) 3 June 11th 09 11:30 PM
Macros/Protection/Pivot Tables...HELP KDG Excel Discussion (Misc queries) 0 October 19th 06 08:45 PM
Pivot tables and macros Mike Excel Discussion (Misc queries) 1 January 9th 06 04:53 PM
What's the best way to learn Pivot Tables and using Macros in Exc. Shirley New Users to Excel 3 April 7th 05 12:47 PM
Manipulating Pivot Tables With Macros Mike Barron Excel Programming 4 October 17th 03 12:13 PM


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