Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default A code to import other xls data into one xls file

Hi there. Can anyone help me in creating a VB code in excel Module that
imports data like file name;direct cost; and year from several xls
spreadsheets [reports_1, reports_2, ...] (from different sheets and cells)
into one spreadsheet [summary] into the following columns accordingly:
(column 1 [file name]: file name; column 2 [direct cost]: dollar amounts,
column 3 [year]: year)? i already have the code that pulls file names from
the folder directory and pastes the data into column 1 [file name]. may be it
will be easier to have the code refer to that column 1. Please note that the
Reports_1, Report_2, etc spreadsheets maintain the same formats and the data
is ocated in the same cells (the same coordinates) and the same sheets with
the same names. thanks in advance.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,480
Default A code to import other xls data into one xls file

Hi alish

Take a look at the methods produced by Ron de Bruin
http://msdn.microsoft.com/en-us/library/cc793964.aspx

--
Regards
Roger Govier

"alish" wrote in message
...
Hi there. Can anyone help me in creating a VB code in excel Module that
imports data like file name;direct cost; and year from several xls
spreadsheets [reports_1, reports_2, ...] (from different sheets and cells)
into one spreadsheet [summary] into the following columns accordingly:
(column 1 [file name]: file name; column 2 [direct cost]: dollar amounts,
column 3 [year]: year)? i already have the code that pulls file names from
the folder directory and pastes the data into column 1 [file name]. may be
it
will be easier to have the code refer to that column 1. Please note that
the
Reports_1, Report_2, etc spreadsheets maintain the same formats and the
data
is ocated in the same cells (the same coordinates) and the same sheets
with
the same names. thanks in advance.

__________ Information from ESET Smart Security, version of virus
signature database 4780 (20100117) __________

The message was checked by ESET Smart Security.

http://www.eset.com




__________ Information from ESET Smart Security, version of virus signature database 4780 (20100117) __________

The message was checked by ESET Smart Security.

http://www.eset.com



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default A code to import other xls data into one xls file

Roger, I think the code will not work in my case as i have to gather or
import data from the different workbook (not worksheets in the same workbook)
into one summary workbook. The way it is arranged is that in C:\ there is a
folder "Main_Report" where I have the Summary_Report.xls. Every month i dump
several folders with several xls files. And when i hit the button in the
Summary_report with the VB codes assigned to it, shold import the file names
in column 1 (that has been taken care already) and other details into the
respective columns from a couple of work sheets from each xls file dumped in
the main folder.

Since i already have the codes to import the files names into the FileNames
column, may be the code that will import the data from the workbooks should
reference the file names, that way to make sure it pulls the correct data
from the correct file.

I know it is challanging and a unique case, but I would appreciate if you
help me with this situations. Thanks.

"Roger Govier" wrote:

Hi alish

Take a look at the methods produced by Ron de Bruin
http://msdn.microsoft.com/en-us/library/cc793964.aspx

--
Regards
Roger Govier

"alish" wrote in message
...
Hi there. Can anyone help me in creating a VB code in excel Module that
imports data like file name;direct cost; and year from several xls
spreadsheets [reports_1, reports_2, ...] (from different sheets and cells)
into one spreadsheet [summary] into the following columns accordingly:
(column 1 [file name]: file name; column 2 [direct cost]: dollar amounts,
column 3 [year]: year)? i already have the code that pulls file names from
the folder directory and pastes the data into column 1 [file name]. may be
it
will be easier to have the code refer to that column 1. Please note that
the
Reports_1, Report_2, etc spreadsheets maintain the same formats and the
data
is ocated in the same cells (the same coordinates) and the same sheets
with
the same names. thanks in advance.

__________ Information from ESET Smart Security, version of virus
signature database 4780 (20100117) __________

The message was checked by ESET Smart Security.

http://www.eset.com




__________ Information from ESET Smart Security, version of virus signature database 4780 (20100117) __________

The message was checked by ESET Smart Security.

http://www.eset.com



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,480
Default A code to import other xls data into one xls file

Hi alish

Take another look at the link I gave you.
Ron has a section there called Merging a Range from All Workbooks in a
Folder.
The Sub MergeAllWorkbooks() will do what you want.
It doesn't need a column with a list of the filenames.
You specify the folder where your files for importing are stored, and it
will loop through each of the files found there in turn and extract the
range of data you specify and import it all to one sheet in your Summary
workbook.

Instead of
Every month i dump several folders with several xls files.

dump the files you want imported into a single folder.
--
Regards
Roger Govier

"alish" wrote in message
...
Roger, I think the code will not work in my case as i have to gather or
import data from the different workbook (not worksheets in the same
workbook)
into one summary workbook. The way it is arranged is that in C:\ there is
a
folder "Main_Report" where I have the Summary_Report.xls. Every month i
dump
several folders with several xls files. And when i hit the button in the
Summary_report with the VB codes assigned to it, shold import the file
names
in column 1 (that has been taken care already) and other details into the
respective columns from a couple of work sheets from each xls file dumped
in
the main folder.

Since i already have the codes to import the files names into the
FileNames
column, may be the code that will import the data from the workbooks
should
reference the file names, that way to make sure it pulls the correct data
from the correct file.

I know it is challanging and a unique case, but I would appreciate if you
help me with this situations. Thanks.

"Roger Govier" wrote:

Hi alish

Take a look at the methods produced by Ron de Bruin
http://msdn.microsoft.com/en-us/library/cc793964.aspx

--
Regards
Roger Govier

"alish" wrote in message
...
Hi there. Can anyone help me in creating a VB code in excel Module that
imports data like file name;direct cost; and year from several xls
spreadsheets [reports_1, reports_2, ...] (from different sheets and
cells)
into one spreadsheet [summary] into the following columns accordingly:
(column 1 [file name]: file name; column 2 [direct cost]: dollar
amounts,
column 3 [year]: year)? i already have the code that pulls file names
from
the folder directory and pastes the data into column 1 [file name]. may
be
it
will be easier to have the code refer to that column 1. Please note
that
the
Reports_1, Report_2, etc spreadsheets maintain the same formats and the
data
is ocated in the same cells (the same coordinates) and the same sheets
with
the same names. thanks in advance.

__________ Information from ESET Smart Security, version of virus
signature database 4780 (20100117) __________

The message was checked by ESET Smart Security.

http://www.eset.com




__________ Information from ESET Smart Security, version of virus
signature database 4780 (20100117) __________

The message was checked by ESET Smart Security.

http://www.eset.com




__________ Information from ESET Smart Security, version of virus
signature database 4798 (20100122) __________

The message was checked by ESET Smart Security.

http://www.eset.com




__________ Information from ESET Smart Security, version of virus signature database 4798 (20100122) __________

The message was checked by ESET Smart Security.

http://www.eset.com



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
import from text file with VBA code sheela Excel Programming 5 August 18th 09 08:10 PM
Import HTML code from a text file. [email protected] Excel Programming 2 April 1st 05 07:47 AM
Import VBA Code in Excel-File ? (Export VBA Code to file) Matthias Pospiech Excel Programming 2 March 22nd 05 04:56 PM
macro to import file (help with a piece of code) uriel78 Excel Programming 4 March 12th 05 08:36 AM
File-Open import code available anywhere? Pal Excel Programming 0 February 27th 04 11:40 PM


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