Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
automatically appending newly added data on worksheet to a master list worksheet | Links and Linking in Excel | |||
plot graph from multiple worksheet as embedded chart object on every worksheet | Excel Discussion (Misc queries) | |||
plot graph from multiple worksheet as embedded chart object on every worksheet | Excel Worksheet Functions | |||
Upload multiple text files into 1 excel worksheet + put the filename as the first column in the worksheet | Excel Worksheet Functions | |||
Attaching a JET database to an Excel Worksheet OR storing large binary data in a worksheet | Excel Programming |