Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9
Default Importing Data Question

Hello. I have over 2000 separate Excel 2000 files that are all
formatted exactly the same way. I need to take the data from three of
the cells and put them into a table in a separate Excel worksheet.

If I open up 100 files at a time, how would I create a macro that
would add the data from each worksheet into the new destination
worksheet, allowing me to close the 100 files and then open up another
100 files which would be added onto the new worksheet, etc.

Thank you.

Steven

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,355
Default Importing Data Question

Are the 2000 files all in the same folder or in multiple folders?

"Steven" wrote:

Hello. I have over 2000 separate Excel 2000 files that are all
formatted exactly the same way. I need to take the data from three of
the cells and put them into a table in a separate Excel worksheet.

If I open up 100 files at a time, how would I create a macro that
would add the data from each worksheet into the new destination
worksheet, allowing me to close the 100 files and then open up another
100 files which would be added onto the new worksheet, etc.

Thank you.

Steven


  #3   Report Post  
Posted to microsoft.public.excel.misc
jaf jaf is offline
external usenet poster
 
Posts: 300
Default Importing Data Question

Hi Steven,
I would use a different approach.
Use the windows command window to get the filenames into a text file.

Dir textfilename.txt

Copy & paste the names into a column.
In the next column enter ='c:\path\[" & $a$1 & "]sheetname"'!$D$47"
(Thats a double quote followed by a single quote before the !)
Change "path" to your path.
Change "sheetname" to your sheets name. (and pray they are the same in each
wb)
Change "D47" to your first remote cell.
In the next 2 columns change the cell address.

This creates a link to the data in the spreadsheets.
Do a fill down with your 3 columns to row 2000 and you have the data.
Select & copy the data, do a paste special "values" to break the links.

A1 | B1
|C1
wb1.xls ='c:\path\[" & a1 & "]sheetname"'!$D$47" ='c:\path\[" & a1
& "]sheetname"'!$K$500"

Of course, if your hobby is opening spreadsheets you can do it the long
way.;<)


--
John
johnf202 at hot mail dot com


"Steven" wrote in message
oups.com...
Hello. I have over 2000 separate Excel 2000 files that are all
formatted exactly the same way. I need to take the data from three of
the cells and put them into a table in a separate Excel worksheet.

If I open up 100 files at a time, how would I create a macro that
would add the data from each worksheet into the new destination
worksheet, allowing me to close the 100 files and then open up another
100 files which would be added onto the new worksheet, etc.

Thank you.

Steven



  #4   Report Post  
Posted to microsoft.public.excel.misc
jaf jaf is offline
external usenet poster
 
Posts: 300
Default Importing Data Question

Sorry that should be...

='c:\path\[" & a1 & "]sheetname"'!"$D$47

And be prepared to wait awhile for the remote links to update.


--
John
johnf202 at hot mail dot com


"jaf" wrote in message
...
Hi Steven,
I would use a different approach.
Use the windows command window to get the filenames into a text file.

Dir textfilename.txt

Copy & paste the names into a column.
In the next column enter ='c:\path\[" & $a$1 & "]sheetname"'!$D$47"
(Thats a double quote followed by a single quote before the !)
Change "path" to your path.
Change "sheetname" to your sheets name. (and pray they are the same in
each wb)
Change "D47" to your first remote cell.
In the next 2 columns change the cell address.

This creates a link to the data in the spreadsheets.
Do a fill down with your 3 columns to row 2000 and you have the data.
Select & copy the data, do a paste special "values" to break the links.

A1 | B1 |C1
wb1.xls ='c:\path\[" & a1 & "]sheetname"'!$D$47" ='c:\path\[" &
a1 & "]sheetname"'!$K$500"

Of course, if your hobby is opening spreadsheets you can do it the long
way.;<)


--
John
johnf202 at hot mail dot com


"Steven" wrote in message
oups.com...
Hello. I have over 2000 separate Excel 2000 files that are all
formatted exactly the same way. I need to take the data from three of
the cells and put them into a table in a separate Excel worksheet.

If I open up 100 files at a time, how would I create a macro that
would add the data from each worksheet into the new destination
worksheet, allowing me to close the 100 files and then open up another
100 files which would be added onto the new worksheet, etc.

Thank you.

Steven





  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Importing Data Question

And the real bad news is that you'd have to use =indirect() with a string like
this. And =indirect() won't work if the sending workbook is closed.

But you could use the same sort of technique to build the formula that points
directly at the closed workbook.

So with your workbook name in A1, you could use a formula like this:

="$$$'c:\path\[" & a1 & "]sheetname'!$D$47"

(Change c:\path\ and sheetname to what's required)
and drag down the column.

This'll end up with a string that looks like:
$$$'c:\path\[book1.xls]sheetname'!$D$47

Now select this column and convert it to values
And finally make that string into a real formula:
Select that column
Edit|replace
what: $$$
with: =
replace all

I'd do a small amount of these to test. If you've made a typo and do all 2000
formulas, you'll be dismissing 2000 "where's that workbook" dialogs.





jaf wrote:

Sorry that should be...

='c:\path\[" & a1 & "]sheetname"'!"$D$47

And be prepared to wait awhile for the remote links to update.

--
John
johnf202 at hot mail dot com

"jaf" wrote in message
...
Hi Steven,
I would use a different approach.
Use the windows command window to get the filenames into a text file.

Dir textfilename.txt

Copy & paste the names into a column.
In the next column enter ='c:\path\[" & $a$1 & "]sheetname"'!$D$47"
(Thats a double quote followed by a single quote before the !)
Change "path" to your path.
Change "sheetname" to your sheets name. (and pray they are the same in
each wb)
Change "D47" to your first remote cell.
In the next 2 columns change the cell address.

This creates a link to the data in the spreadsheets.
Do a fill down with your 3 columns to row 2000 and you have the data.
Select & copy the data, do a paste special "values" to break the links.

A1 | B1 |C1
wb1.xls ='c:\path\[" & a1 & "]sheetname"'!$D$47" ='c:\path\[" &
a1 & "]sheetname"'!$K$500"

Of course, if your hobby is opening spreadsheets you can do it the long
way.;<)


--
John
johnf202 at hot mail dot com


"Steven" wrote in message
oups.com...
Hello. I have over 2000 separate Excel 2000 files that are all
formatted exactly the same way. I need to take the data from three of
the cells and put them into a table in a separate Excel worksheet.

If I open up 100 files at a time, how would I create a macro that
would add the data from each worksheet into the new destination
worksheet, allowing me to close the 100 files and then open up another
100 files which would be added onto the new worksheet, etc.

Thank you.

Steven




--

Dave Peterson


  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,355
Default Importing Data Question

I've done something much like this to get data from Excel workbooks stored on
the West Coast when I'm on the East Coast. The rate limiting step is the
time it takes to open the files over the network. If the workbooks are
local, it runs quite fast. I have all that code on another laptop here. If
I have time, I'll find it and post it here if it's still needed.

"Dave Peterson" wrote:

And the real bad news is that you'd have to use =indirect() with a string like
this. And =indirect() won't work if the sending workbook is closed.

But you could use the same sort of technique to build the formula that points
directly at the closed workbook.

So with your workbook name in A1, you could use a formula like this:

="$$$'c:\path\[" & a1 & "]sheetname'!$D$47"

(Change c:\path\ and sheetname to what's required)
and drag down the column.

This'll end up with a string that looks like:
$$$'c:\path\[book1.xls]sheetname'!$D$47

Now select this column and convert it to values
And finally make that string into a real formula:
Select that column
Edit|replace
what: $$$
with: =
replace all

I'd do a small amount of these to test. If you've made a typo and do all 2000
formulas, you'll be dismissing 2000 "where's that workbook" dialogs.





jaf wrote:

Sorry that should be...

='c:\path\[" & a1 & "]sheetname"'!"$D$47

And be prepared to wait awhile for the remote links to update.

--
John
johnf202 at hot mail dot com

"jaf" wrote in message
...
Hi Steven,
I would use a different approach.
Use the windows command window to get the filenames into a text file.

Dir textfilename.txt

Copy & paste the names into a column.
In the next column enter ='c:\path\[" & $a$1 & "]sheetname"'!$D$47"
(Thats a double quote followed by a single quote before the !)
Change "path" to your path.
Change "sheetname" to your sheets name. (and pray they are the same in
each wb)
Change "D47" to your first remote cell.
In the next 2 columns change the cell address.

This creates a link to the data in the spreadsheets.
Do a fill down with your 3 columns to row 2000 and you have the data.
Select & copy the data, do a paste special "values" to break the links.

A1 | B1 |C1
wb1.xls ='c:\path\[" & a1 & "]sheetname"'!$D$47" ='c:\path\[" &
a1 & "]sheetname"'!$K$500"

Of course, if your hobby is opening spreadsheets you can do it the long
way.;<)


--
John
johnf202 at hot mail dot com


"Steven" wrote in message
oups.com...
Hello. I have over 2000 separate Excel 2000 files that are all
formatted exactly the same way. I need to take the data from three of
the cells and put them into a table in a separate Excel worksheet.

If I open up 100 files at a time, how would I create a macro that
would add the data from each worksheet into the new destination
worksheet, allowing me to close the 100 files and then open up another
100 files which would be added onto the new worksheet, etc.

Thank you.

Steven




--

Dave Peterson

  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Importing Data Question

I've done the same kind of thing.

Sometimes, I'd copy the files located on a network drive to my harddrive
manually--sometimes, I'd use excel's FileCopy or FSO's CopyFile to do the real
work.



Barb Reinhardt wrote:

I've done something much like this to get data from Excel workbooks stored on
the West Coast when I'm on the East Coast. The rate limiting step is the
time it takes to open the files over the network. If the workbooks are
local, it runs quite fast. I have all that code on another laptop here. If
I have time, I'll find it and post it here if it's still needed.

"Dave Peterson" wrote:

And the real bad news is that you'd have to use =indirect() with a string like
this. And =indirect() won't work if the sending workbook is closed.

But you could use the same sort of technique to build the formula that points
directly at the closed workbook.

So with your workbook name in A1, you could use a formula like this:

="$$$'c:\path\[" & a1 & "]sheetname'!$D$47"

(Change c:\path\ and sheetname to what's required)
and drag down the column.

This'll end up with a string that looks like:
$$$'c:\path\[book1.xls]sheetname'!$D$47

Now select this column and convert it to values
And finally make that string into a real formula:
Select that column
Edit|replace
what: $$$
with: =
replace all

I'd do a small amount of these to test. If you've made a typo and do all 2000
formulas, you'll be dismissing 2000 "where's that workbook" dialogs.





jaf wrote:

Sorry that should be...

='c:\path\[" & a1 & "]sheetname"'!"$D$47

And be prepared to wait awhile for the remote links to update.

--
John
johnf202 at hot mail dot com

"jaf" wrote in message
...
Hi Steven,
I would use a different approach.
Use the windows command window to get the filenames into a text file.

Dir textfilename.txt

Copy & paste the names into a column.
In the next column enter ='c:\path\[" & $a$1 & "]sheetname"'!$D$47"
(Thats a double quote followed by a single quote before the !)
Change "path" to your path.
Change "sheetname" to your sheets name. (and pray they are the same in
each wb)
Change "D47" to your first remote cell.
In the next 2 columns change the cell address.

This creates a link to the data in the spreadsheets.
Do a fill down with your 3 columns to row 2000 and you have the data.
Select & copy the data, do a paste special "values" to break the links.

A1 | B1 |C1
wb1.xls ='c:\path\[" & a1 & "]sheetname"'!$D$47" ='c:\path\[" &
a1 & "]sheetname"'!$K$500"

Of course, if your hobby is opening spreadsheets you can do it the long
way.;<)


--
John
johnf202 at hot mail dot com


"Steven" wrote in message
oups.com...
Hello. I have over 2000 separate Excel 2000 files that are all
formatted exactly the same way. I need to take the data from three of
the cells and put them into a table in a separate Excel worksheet.

If I open up 100 files at a time, how would I create a macro that
would add the data from each worksheet into the new destination
worksheet, allowing me to close the 100 files and then open up another
100 files which would be added onto the new worksheet, etc.

Thank you.

Steven




--

Dave Peterson


--

Dave Peterson
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
Question For Importing Data Into Excel/Converting General Number to Dollar Amount [email protected] Excel Discussion (Misc queries) 3 February 12th 07 09:30 PM
date importing - a different question Sergei D Excel Discussion (Misc queries) 0 July 31st 06 08:34 PM
Importing data, then adding data to the new spreadsheet.. a conund AndyL82 Excel Discussion (Misc queries) 1 March 9th 06 10:05 PM
Complex question about importing, analyzing data [email protected] Excel Discussion (Misc queries) 3 December 26th 05 12:55 AM
Importing Question! Otto Moehrbach Excel Discussion (Misc queries) 0 November 26th 04 07:04 PM


All times are GMT +1. The time now is 01:24 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"