Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
ms ms is offline
external usenet poster
 
Posts: 1
Default how to read multiple workbooks, collect a few cells from each?

I get data in the form of 100 to 300 spreadsheets on a CD-ROM.
I only need a few numbers from each spreadsheet, let's say they
are in cells B4 and C7.
I would like a macro to read each workbook in a folder, and put
its B4 into column B and C7 into column C. i.e
B2 = B4 of 1st workbook
C2 = C7 of 1st workbook
B3 = B4 of 2nd workbook
C3 = C7 of 2nd workbook
B4 = B4 of 3rd workbook etc.

I know how to open muliple files in a folder, but not how to
populate a column, incrementing the row each time.
Where might I find a macro to do this?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default how to read multiple workbooks, collect a few cells from each?

psuedo code
dim rw as Row
Wkbk as Workbook
rw = 2
for each wkbk in ListofWorkbooks
' assume wkbk holds a reference to one of the
' workbooks which you have opened and this code
' is in the workbook where you want the summary

with Thisworkbook.worksheets("Sheet1")
.Cells(rw,"B").Value = wkbk.worksheets(1). _
Range("B4").value
.Cells(rw,"C").Value = wkbk.worksheets(1). _
Range("C7").value
rw = rw + 1
End With


--
Regards,
Tom Ogilvy

ms wrote in message
...
I get data in the form of 100 to 300 spreadsheets on a CD-ROM.
I only need a few numbers from each spreadsheet, let's say they
are in cells B4 and C7.
I would like a macro to read each workbook in a folder, and put
its B4 into column B and C7 into column C. i.e
B2 = B4 of 1st workbook
C2 = C7 of 1st workbook
B3 = B4 of 2nd workbook
C3 = C7 of 2nd workbook
B4 = B4 of 3rd workbook etc.

I know how to open muliple files in a folder, but not how to
populate a column, incrementing the row each time.
Where might I find a macro to do this?



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
Collect data from spesific cell in multiple sheets Espen Rostad[_2_] Excel Discussion (Misc queries) 4 March 16th 10 09:20 AM
Need Macro to Collect Multiple Worksheet Names navel151 Excel Worksheet Functions 3 February 21st 10 06:19 PM
How can collect data from multiple sheets in the same workbook? rrok Excel Discussion (Misc queries) 1 November 16th 09 03:20 AM
i need info from the top workbook to be read in multiple workbooks sfsddiamond Excel Worksheet Functions 0 November 9th 05 04:41 PM
adding certain cells in multiple worksheets in multiple workbooks Stephen via OfficeKB.com Excel Worksheet Functions 1 February 4th 05 08:31 PM


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