Is there any function for importing data from other workbooks?

  • Thread starter Thread starter Notor
  • Start date Start date
N

Notor

Hi

Is there any function with which I can import a specific
range of cells from another excel workbook into the one
I'm using? Any help greatly appreciated.

Peter Baranya
 
Try something like this Notor

Sub test()
Dim Wb1 As Workbook
Dim Wb2 As Workbook
Application.ScreenUpdating = False
Set Wb1 = ActiveWorkbook
Set Wb2 = Workbooks.Open("C:\test.xls")
Wb2.Sheets("Sheet1").Range("a2:h600").copy _
Wb1.Sheets("sheet1").Range("a1")
Wb2.Close False
Application.ScreenUpdating = True
End Sub
 
Can you be more specific about how one goes about applkying this? Is it a
spreadshet function?

I would like to import some exteral data as well as a possible aternative to
my time problems mm:ss or m:ss that I cant seem to do much with in excel.

I certainly dont understand where you are speaking of applying such a thing.

Mark
 
To clarify, in part.... Notor asked for a function <<for which there isn't
one, that I know of>> so Ron responded (without saying so) and furnished
VBA code. Ron's code goes inside a standard module off of an empty Workbook
entitled "Wb1.xls".

Create a second Workbook "Wb2.xls" and enter test data in cells a2:h600 and
Save the Workbook.

Switch back to "Wb1.xls" and run Macro Test.
The data from Wb2.xls should now be in Wb1.xls cells A1:h599.
HTH
 
Back
Top