Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Creating a database and PivotTable with a Macro

I need to create a master workbook that reads from several other workbooks each containing a single worksheet. The data from one week will need to be kept for the following week to be compared. I know that a database and a pivottable will probably be the best way to do this, but I'm not familiar enough with writing macros to know how to proceed. Any help would be great.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Creating a database and PivotTable with a Macro

Dim sh as Worksheet
Dim wkbk as Workbook
Dim i as Long, sPath as String
Dim rng as Range
Dim varr as Variant
workbooks("Master.xls").Worksheets.Add
set sh = Activesheet
sPath = "C:\Myfolder\Myfiles\"
varr = Array("bk1.xls", "bk2.xls", . . . , "bk7.xls")
for i = lbound(varr) to ubound(varr)
set wkbk = workbooks.open( sPath & varr(i))
set rng = sh.Cells(rows.count,1).End(xlup)(2)
wkbk.Worksheets(1).Range("A1").Currentregion.Copy _
Destination:=rng
wkbk.close Savechanges:=False
Next

--
Regards,
Tom Ogilvy

"sales26" wrote in message
...
I need to create a master workbook that reads from several other workbooks

each containing a single worksheet. The data from one week will need to be
kept for the following week to be compared. I know that a database and a
pivottable will probably be the best way to do this, but I'm not familiar
enough with writing macros to know how to proceed. Any help would be great.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default Creating a database and PivotTable with a Macro

Try this:
http://msdn.microsoft.com/library/de...artreports.asp
This one is good:
http://www.microsoft.com/exceldev/articles/movs104.htm

--
Toby Erkson
Oregon, USA
Excel 2002 in Windows XP

"sales26" wrote in message
...
I need to create a master workbook that reads from several other workbooks

each containing a single worksheet. The data from one week will need to be
kept for the following week to be compared. I know that a database and a
pivottable will probably be the best way to do this, but I'm not familiar
enough with writing macros to know how to proceed. Any help would be great.


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
Using Excel PivotTable for a huge DataBase from External Data marcher Excel Discussion (Misc queries) 0 September 9th 08 07:59 PM
Creating a PivotTable w/o selecting data in an existing PivotTable Damian Excel Discussion (Misc queries) 6 November 2nd 07 04:44 PM
Addin for updating database by ammending pivottable nc Excel Discussion (Misc queries) 0 November 6th 06 08:51 AM
creating a database and database query Tim Excel Programming 1 March 5th 04 06:17 PM
Pivottable database connections Derek[_6_] Excel Programming 1 December 5th 03 10:36 AM


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