Tip: Other languages are Google-Translated. You can visit the English version of this link.
Log in
x
or
x
x
Register
x

or

How to import data from another worksheet?

When you operate an Excel file, you may want to import some data from another worksheet into your current worksheet. Today, I will talk about some interesting tricks for you to deal with this problem.

Import data from another worksheet with Connections function

Import data from another worksheet with VBA code

Import data from another worksheet with Kutools for Excel


arrow blue right bubble Import data from another worksheet with Connections function


If you are familiar with the Connections feature in Excel, you can import another worksheet data into current workbook, and your imported data will be updated with the original data automatically.

1. Go to click Data > Connections, see screenshot:

doc-import-data-to-worksheet-1

2. In the Workbook Connections dialog, click Add button, and in the popped out Existing Connections dialog, click Browse for More button, see screenshots:

doc-import-data-to-worksheet-2
-1
doc-import-data-to-worksheet-3

3. And then choose the workbook that you want to export its data to current worksheet.

doc-import-data-to-worksheet-1

4. After choosing the workbook, please click Open button, and select one worksheet that you want to use. See screenshot:

doc-import-data-to-worksheet-1

5. Then click OK, it will return to the Workbook Connections dialog box, and your selected workbook is added to the list box, please close this dialog.

6. Then go on clicking Data > Existing Connections, see screenshot:

doc-import-data-to-worksheet-1

7. In the Existing Connections dialog box, click the workbook that you are added just now, and click Open button. See screenshot:

doc-import-data-to-worksheet-1

8. And in the popped out Import Data dialog, choose one option you like from the Select how you want to view this data in your workbook, and then choose one the existing worksheet range or a new worksheet to put the data.

doc-import-data-to-worksheet-1

9. Then click OK, the data from another worksheet has been imported into your specified worksheet.

doc-import-data-to-worksheet-1

Notes:

1. Using this method, you can import the data with the type of table, PivotTable Report or PivotChart and PivotTable Report.

2. Your workbook has been connected to that external data, if you want to get the latest data in your own workbook. Go to Data > Refresh All to get the updated data.

doc-import-data-to-worksheet-1


arrow blue right bubble Import data from another worksheet with VBA code

There are so many steps of above method, may be you will feel tired, here, the following VBA code also can help you to import data from another worksheet.

1. Hold down the ALT + F11 keys, and it opens the Microsoft Visual Basic for Applications window.

2. Click Insert > Module, and paste the following code in the Module Window.

VBA code: Import data from another worksheet

Sub ImportDatafromotherworksheet()
    Dim wkbCrntWorkBook As Workbook
    Dim wkbSourceBook As Workbook
    Dim rngSourceRange As Range
    Dim rngDestination As Range
    Set wkbCrntWorkBook = ActiveWorkbook
    With Application.FileDialog(msoFileDialogOpen)
        .Filters.Clear
        .Filters.Add "Excel 2007-13", "*.xlsx; *.xlsm; *.xlsa"
        .AllowMultiSelect = False
        .Show
        If .SelectedItems.Count > 0 Then
            Workbooks.Open .SelectedItems(1)
            Set wkbSourceBook = ActiveWorkbook
            Set rngSourceRange = Application.InputBox(prompt:="Select source range", Title:="Source Range", Default:="A1", Type:=8)
            wkbCrntWorkBook.Activate
            Set rngDestination = Application.InputBox(prompt:="Select destination cell", Title:="Select Destination", Default:="A1", Type:=8)
            rngSourceRange.Copy rngDestination
            rngDestination.CurrentRegion.EntireColumn.AutoFit
            wkbSourceBook.Close False
        End If
    End With
End Sub

3. Then press F5 key to run this code, and choose the workbook that you want to insert its data into current workbook, see screenshot:

doc-import-data-to-worksheet-1

4. After selecting the workbook, then click Open button, and select a worksheet or a range of your specified workbook which data you need to export. See screenshot:

doc-import-data-to-worksheet-1

5. Then click OK, and select one cell to put your imported data in your current worksheet, see screenshot:

doc-import-data-to-worksheet-1

6. Go on clicking OK, and your selected data has been imported into your worksheet.

Note: With this method, the imported data will not update with the original data.


arrow blue right bubble Import data from another worksheet with Kutools for Excel

Kutools for Excel also provides Insert File at Cursor feature for you to solve this problem.

Kutools for Excel includes more than 300 handy Excel tools. Free to try with no limitation in 30 days. Get it Now

1. Open your workbook that you want to insert another worksheet data.

2. Click Enterprise > Import / Export > Insert File at Cursor, see screenshot:

doc-import-data-to-worksheet-1

3. And in the Insert File at Cursor dialog box, select a cell which you want to put the data begin in, and then click Browse button to select one workbook that you want to insert.

doc-import-data-to-worksheet-1

4. Then click OK, and choose one worksheet if your workbook contains multiple worksheets from the Select a Worksheet dialog, see screenshot:

doc-import-data-to-worksheet-1

5. And then click OK, your selected worksheet has been imported into your specific worksheet.

Note: With this method, the imported data will not update with the original data.

To know more about this Insert File at Cursor feature.


Related article:

How to import a text file or worksheet in Excel?


Recommended Productivity Tools

Ribbon of Excel (with Kutools for Excel installed)

300+ Advanced Features Increase Your Productivity by 71%, and Help You To Stand Out From Crowd!

Would you like to complete your daily work quickly and perfectly? Kutools For Excel brings 300+ cool and powerful advanced features (Combine workbooks, sum by color, split cell contents, convert date, and so on...) for 1500+ work scenarios, helps you solve 82% Excel problems.

  •  Deal with all complicated tasks in seconds, help to enhance your work ability, get success from the fierce competition, and never worry about being fired.
  •  Save a lot of work time, leave much time for you to love and care the family and enjoy a comfortable life now.
  •  Reduce thousands of keyboard and mouse clicks every day, relieve your tired eyes and hands, and give you a healthy body.
  •  Become an Excel expert in 3 minutes, and get admiring glance from your colleagues or friends.
  •  No longer need to remember any painful formulas and VBA codes, have a relaxing and pleasant mind, give you a thrill you've never had before.
  •  Spend only $39, but worth than $4000 training of others. Being used by 110,000 elites and 300+ well-known companies.
  •  60-day unlimited free trial. 60-day money back guarantee. Free upgrade and support for 2 years. Buy once, use forever.
  •  Change the way you work now, and give you a better life immediately!

Office Tab Brings Efficient And Handy Tabs to Office (include Excel), Just Like Chrome, Firefox, And New IE

  • Increases your productivity by 50% when viewing and editing multiple documents.
  • Reduce hundreds of mouse clicks for you every day, say goodbye to mouse hand.
  • Open and create documents in new tabs of same window, rather than in new windows.
  • Help you work faster and easily stand out from the crowd! One second to switch between dozens of open documents!
Say something here...
symbols left.
You are guest ( Sign Up? )
or post as a guest, but your post won't be published automatically.
Loading comment... The comment will be refreshed after 00:00.
  • To post as a guest, your comment is unpublished.
    Corbin · 2 months ago
    This post is FANTASTIC!!!! This is extremely helpful! Thank you!!!
  • To post as a guest, your comment is unpublished.
    Mohamed · 9 months ago
    How can i use relative paths instead of fixed paths,
    because these files will be uploaded to SVN and paths will be differ
  • To post as a guest, your comment is unpublished.
    Mayan · 10 months ago
    This was incredibly useful. Thank you!
  • To post as a guest, your comment is unpublished.
    RS · 1 years ago
    I am using the VBA Code. How can I unhide and remove all filter before select source range?
    • To post as a guest, your comment is unpublished.
      Venky · 3 months ago
      Sub Clear()
      '
      ' Clean Sheet
      '
      Dim A As Long

      Sheets("Sheet1").Select
      ActiveSheet.Range("Range").Select
      Selection.Clear

      End Sub


      Example
      range mean A2:D35
  • To post as a guest, your comment is unpublished.
    keegan · 1 years ago
    How do I adapt the VBA code so that it will continuously update with another file?