Importing from Excel to Excel using VB. 
Author Message
 Importing from Excel to Excel using VB.

Hello,

I have an Excel master documet, Every morning I get 3 excelfiles that I need
to import som info from into the master.

I'm interested in making a VB 5 program with to command buttons only
Update Master and Exit.

There are only 1 column in each of the 3 files that need to be imported.
column 3

I want the master document to be visual if possible.

Anyone who can get me started with an example.

regards

Stein Johannessen



Wed, 18 Jun 1902 08:00:00 GMT  
 Importing from Excel to Excel using VB.
I have done somthing similar. But I had to import/export csv-files and was just
coding it with vba. (not a real vb-project)
but you could also write a macro in excel and then start it with your
vb-project.

Here is a code-fragment that could be useful for you:
according to your short discription i assume that you have just one sheet in
your excel file. otherwise you have to be careful, in which sheet to copy.

Of course you have to adopt it and create your own variables with your file
names...
(sorry that there is no comment, but the comment i have is german)

greetings Arno

                Workbooks.Open FileName:=Path + ToOpenFile
                Windows(ToOpenFile).Activate
                Worksheets(DialogName + "_" + Trim(Str(FileNumber)) + "_" +
SheetName).Range(myRange).Select

                Selection.Copy
                Windows(Plain).Activate
                Worksheets.Add.Name = SheetName
                Worksheets(SheetName).Range(myRange).Select
                ActiveSheet.Paste
                Selection.Columns.AutoFit
                Worksheets(SheetName).Range("A1").Select
                Selection.Copy
                Windows(ToOpenFile).Close SaveChanges:=False

Quote:

> Hello,

> I have an Excel master documet, Every morning I get 3 excelfiles that I need
> to import som info from into the master.

> I'm interested in making a VB 5 program with to command buttons only
> Update Master and Exit.

> There are only 1 column in each of the 3 files that need to be imported.
> column 3

> I want the master document to be visual if possible.

> Anyone who can get me started with an example.

> regards

> Stein Johannessen


--
Arno Kersche
Neptunweg 4/7
A-9020 Klagenfurt
Austria, Europe
Phone: +43/(0)699/12763818





Wed, 18 Jun 1902 08:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Importing data from Excel to Access using VB???

2. Using VB to import excel data into Corel

3. Importing data from Excel to Access using VB???

4. Importing Excel Spreadsheet into an Access 2000 Table using VB

5. importing Excel Spreadsheets using code?

6. Problems using VBA to link or DAO to import Excel file into Access97

7. Importing text file into Excel using VBA - from a word macro

8. Import excel spreadsheet to claendar using a macro

9. Using VBA to Import a Range from an Excel Workbook

10. Help with importing excel into access using VBscript

11. Help!: Import Access Table into Excel Using VB3

12. Unable to import SAS data into ACCESS97 or EXCEL 2000 using the SAS ODBC driver

 

 
Powered by phpBB® Forum Software