Skip to main content

How to import data from another worksheet?

Author: Xiaoyang Last Modified: 2014-06-30

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?

Best Office Productivity Tools

🤖 Kutools AI Aide: Revolutionize data analysis based on: Intelligent Execution   |  Generate Code  |  Create Custom Formulas  |  Analyze Data and Generate Charts  |  Invoke Kutools Functions
Popular Features: Find, Highlight or Identify Duplicates   |  Delete Blank Rows   |  Combine Columns or Cells without Losing Data   |   Round without Formula ...
Super Lookup: Multiple Criteria VLookup    Multiple Value VLookup  |   VLookup Across Multiple Sheets   |   Fuzzy Lookup ....
Advanced Drop-down List: Quickly Create Drop Down List   |  Dependent Drop Down List   |  Multi-select Drop Down List ....
Column Manager: Add a Specific Number of Columns  |  Move Columns  |  Toggle Visibility Status of Hidden Columns  |  Compare Ranges & Columns ...
Featured Features: Grid Focus   |  Design View   |   Big Formula Bar    Workbook & Sheet Manager   |  Resource Library (Auto Text)   |  Date Picker   |  Combine Worksheets   |  Encrypt/Decrypt Cells    Send Emails by List   |  Super Filter   |   Special Filter (filter bold/italic/strikethrough...) ...
Top 15 Toolsets12 Text Tools (Add Text, Remove Characters, ...)   |   50+ Chart Types (Gantt Chart, ...)   |   40+ Practical Formulas (Calculate age based on birthday, ...)   |   19 Insertion Tools (Insert QR Code, Insert Picture from Path, ...)   |   12 Conversion Tools (Numbers to Words, Currency Conversion, ...)   |   7 Merge & Split Tools (Advanced Combine Rows, Split Cells, ...)   |   ... and more

Supercharge Your Excel Skills with Kutools for Excel, and Experience Efficiency Like Never Before. Kutools for Excel Offers Over 300 Advanced Features to Boost Productivity and Save Time.  Click Here to Get The Feature You Need The Most...

Description


Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier

  • Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
  • Open and create multiple documents in new tabs of the same window, rather than in new windows.
  • Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!
Comments (12)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
How to import only values with VBA, this VBA paste formulas when importing?
This comment was minimized by the moderator on the site
Amazing, thank you
This comment was minimized by the moderator on the site
This post is FANTASTIC!!!! This is extremely helpful! Thank you!!!
This comment was minimized by the moderator on the site
How can i use relative paths instead of fixed paths,
because these files will be uploaded to SVN and paths will be differ
This comment was minimized by the moderator on the site
This was incredibly useful. Thank you!
There are no comments posted here yet
Load More
Leave your comments
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations