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

Hi all,
briefly saying,
I need to construct a sets of date coming from two workbooks.
Each workbook has identical collection of sheets(same names) with
different data.
I would like to run a procedure that for each worksheet in Workbook1
copies a range of data into Workbook "SUM" and the same range out of
respective worksheet from Workbook2 again into Workbook "SUM"
Then after I have data from them both I can do sth. (create graph) and
then go to next worksheet in Workbook1

Oh wow hope it is OK to understand
thanks in advance,
Bartek
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default for each worksheet ...

Bartek wrote:
briefly saying,
I need to construct a sets of date coming from two workbooks.
Each workbook has identical collection of sheets(same names) with
different data.
I would like to run a procedure that for each worksheet in Workbook1
copies a range of data into Workbook "SUM" and the same range out of
respective worksheet from Workbook2 again into Workbook "SUM"
Then after I have data from them both I can do sth. (create graph) and
then go to next worksheet in Workbook1

Oh wow hope it is OK to understand
thanks in advance, Bartek


I hope this is a usefull start:
Sub SubName()
Dim nRow&, iCol%
Dim WB1 As Workbook, WB2 As Workbook
Dim WS1 As Worksheet, WS2 As Worksheet
Workbooks("SUM.xls").Activate ' Totals
nRow = 5 ' number of data rows
Set WB1 = Workbooks("Book1.xls")
Set WB2 = Application.Workbooks("Book2.xls")
iCol = 1
For Each WS1 In WB1.Worksheets
Set WS2 = WB2.Worksheets(WS1.Name)
Cells(1, iCol) = WS1.Name ' sheet name
WS1.Cells(1, 1).Resize(nRow, 1).Copy _
Cells(2, iCol) ' from book1
WS2.Cells(1, 1).Resize(nRow, 1).Copy _
Cells(2, iCol + 1) ' from book2
iCol = iCol + 2
Next WS1



----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 100,000 Newsgroups
---= East/West-Coast Server Farms - Total Privacy via Encryption =---
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
automatically appending newly added data on worksheet to a master list worksheet tabylee via OfficeKB.com Links and Linking in Excel 0 December 17th 09 04:24 PM
plot graph from multiple worksheet as embedded chart object on every worksheet [email protected] Excel Discussion (Misc queries) 2 August 24th 06 05:26 PM
plot graph from multiple worksheet as embedded chart object on every worksheet [email protected] Excel Worksheet Functions 2 August 24th 06 05:26 PM
Upload multiple text files into 1 excel worksheet + put the filename as the first column in the worksheet Aster Excel Worksheet Functions 3 March 12th 06 09:58 AM
Attaching a JET database to an Excel Worksheet OR storing large binary data in a worksheet Ant Waters Excel Programming 1 September 3rd 03 11:34 AM


All times are GMT +1. The time now is 03:11 PM.

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"