MS Office Forum

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds

Read in Data from another spreadsheet

  Asked By: Boell    Date: Dec 31    Category: MS Office    Views: 2214

I would like to know if it's possible to read in data from
another excel spreadsheet.

For example, if I have 1 excel work book with 2 spreadsheets, A and B
How do I get information from B to A?

And I would like to read each line and input it into an array.

Is this possible?



3 Answers Found

Answer #1    Answered By: Jeffrey Washington     Answered On: Dec 31

You should be able to record a macro copy the information  (Tools-
Macro-Record). Then, look at the macro to see how it works (Tools-
Macro-Visual Basic Editor). You may get something like:

Sub Macro1()
End Sub

To put values in an array, you can do it like this:

Sub test()
MyArray = Sheets("Sheet1").Range("a1:a3")
'This makes a 3 by 1 variant array.
Debug.Print MyArray(3, 1)
End Sub

Answer #2    Answered By: Landra Schmidt     Answered On: Dec 31

Simpler way:
1- Type an equals sign in the destination cell.
2- Go to the source sheet and click on the source cell.
3- hit Enter. Drag this formula wherever you want.

You used to be able to do this in another workbook, but it is not a
simple any more; it involves Open.

BTW, my on-line help gives step-by-step instructins for these
operations. It is called "Linking" for the search.

Answer #3    Answered By: Alexander Bouchard     Answered On: Dec 31

I have assinged auto_open procedure this
Code to a workbook.

ThisWorkbook.IsAddin =True

It turn out to be an add-in. But I can't use the macros in it ?
When I press Alt+F8 I can not see the macros ?
Where is the problem ?
Is there a workaround to use the macros inside the workbook ?

Didn't find what you were looking for? Find more on Read in Data from another spreadsheet Or get search suggestion and latest updates.