Import data from files with different names to EXCEL D'base.

  • Thread starter Thread starter thunderfoot
  • Start date Start date
T

thunderfoot

I have partly set-up an EXCEL Database which will have a macro to Impor
data from files with _*different_names*_.

These files have all been set-up with the same layouts and contain
worksheets ... 4 require various inputs by the 'End Users' and 1 ha
been set-up so that it has 1 row of information, which is populated b
the Inputs from the other 4 worksheets i.e. by Cell Referencing. Thi
row of data has been given a 'Named Range' ("Database_Line") i
preparation for the Import into the Database (called "CR Database").

My problem is that the 'End Users' will be giving all sorts o
different names to the files to be Imported from.

What I want to happen within an Import Macro, which will operate from
'Button' in "CR Database", is that a Dialogue Box will open so that th
Database Operator can Browse/Navigate to the required file, Select it
then the macro will continue to Import the one 'Named Range
("Database_Line") of information into "CR Database".

*I have most coding sorted, but I just can't work-out how to get
Dialogue Box to open, for Browsing/Navigation, and then for the macr
to continue operating once the required file has been selected
Help!!!!!* :eek:.

Most of my Coding is done by using the 'Record Macro' option withi
EXCEL, but I can edit/add some coding that 'Record Macro' won't do, s
I do have some limits in understanding coding ...... but, for a
"oldy", I'm learning ;).

Help is desperately needed on this, so if you want any further detail
let me know. I'm using EXCEL 2000
 
Thunderfoot,

Something along the lines of

Sub TryNow()
Dim myBk As Workbook
Set myBk = Workbooks.Open(Application.GetOpenFilename _
(, , "Select the file"))
Range("Database_Line").Copy _
ThisWorkbook.Worksheets(1).Range("A65536").End(xlUp)(2)
myBk.Close False
End Sub

HTH,
Bernie
MS Excel MVP


"thunderfoot" <[email protected]>
wrote in message
news:[email protected]...
 
Bernie,

Thanks. This bit of coding is nearly what I want. I can work on it to
get it to do exactly what I want.

You sorted my major problem, which was how to get "Select the File"
dialogue box to open then get the macro to continue once the file was
selected.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top