如何在Excel中將多個工作表中的數據收集到主表中?
在某些時候,您可能需要將多個工作表中的數據收集到一個主工作表中,以進行合併或其他操作,如下圖所示,但是要逐個複制和粘貼內容很麻煩,是否有任何技巧可以快速解決? Excel?
使用合併功能將多張紙中的數據收集到一張
如果要將數據從多個工作表收集到同一工作簿的一個工作表中,則可以在Excel中應用合併功能。
1.在要從工作表中收集數據的工作簿的新工作表中,單擊 數據 > 整合.
2。 在裡面 Consolidate 對話框中,請執行以下操作:
(1在合併數據後選擇要執行的一項操作 功能 下拉列表;
(2點擊 選擇要收集的每張紙的範圍;
(3點擊 Add 按鈕將數據范圍添加到 All references 列錶框;
(4合併數據後檢查使用的標籤,並檢查 Create links to source data 如果要鏈接合併表中的數據與源數據,請選擇此選項。
3。 點擊 OK。 現在,數據已收集並彙總到一張紙中。
輕鬆地將多個工作表/工作簿合併為一個工作表或工作簿
|
在Excel中,將多個工作表或工作簿組合成一個工作表或工作簿可能很麻煩,但是使用 結合 在Kutools for Excel中,您可以將數十個工作表/工作簿合併到一個工作表或工作簿中,也可以通過單擊幾下將工作表合併為一個工作表。 點擊查看全功能 30 天免費試用! |
![]() |
Kutools for Excel:擁有超過 300 個方便的 Excel 加載項,免費試用,不受限制 30 天。 |
使用VBA代碼將多張紙中的數據收集到一張
這是一個VBA代碼,可以從當前工作簿的新工作表中的所有工作表中收集數據。
1。 按 Alt + F11 啟用 Microsoft Visual Basic for Applications 窗口。
2。 點擊 Insert > Module,然後將以下代碼複製並粘貼到 Module 腳本。
VBA:將工作表中的所有數據收集到一個。
Sub Combine()
'UpdatebyExtendoffice20180205
Dim I As Long
Dim xRg As Range
On Error Resume Next
Worksheets.Add Sheets(1)
ActiveSheet.Name = "Combined"
For I = 2 To Sheets.Count
Set xRg = Sheets(1).UsedRange
If I > 2 Then
Set xRg = Sheets(1).Cells(xRg.Rows.Count + 1, 1)
End If
Sheets(I).Activate
ActiveSheet.UsedRange.Copy xRg
Next
End Sub

3. Press F5 key to run the code, all data of the whole workbook has been collected in the new sheet Combined.

Collect data from multiple sheets into one with powerful Combine function
If you usually need to combine sheets into one, I introduce one powerful combine function for you, it’s Kutools for Excel’s Combine utility which have below four main functions:
Combine multiple worksheets from workbook into one worksheet
Combine all same name worksheets into one worksheet
Combine multiple worksheets from workbooks into one workbook
Consolidate and calculate values across multiple workbooks into one worksheet

Kutools for Excel, with more than 300 handy functions, makes your jobs more easier.
After free installing Kutools for Excel, please do as below:
If you just want to combine sheets into one sheet without any other operations, you can do as these:
1. Enable Excel, click Kutools Plus > Combine, there is one or two dialogs pop out to remind you some notices, just click OK and Yes to continue. See screenshot:

2. Click OK to go to the Combine window, check Combine multiple worksheets from workbook into worksheet option.

3. Click Next, then click Add > File / Folder to add workbooks you will use to combine into the Workbook list. Then go to Worksheet list to check the sheets you want to combine form each workbooks.

4. Click Next to go to the last step, you can specify some setting about the combine result as you need. If you do not need this step.

5. Click Finish and select one folder to place the new workbook which combine data from sheets.

6. Click Save. Now all data has been collected from sheets across workbook into one master sheet.

Combine all sheets from workbooks into one worksheet
If you want to consolidate worksheets across workbooks into one, do as these:
1. In the Combine window, check Consolidate and calculate values across multiple worksheets into one worksheet option.

2. Click Next, and add files into Workbook list, then check the sheets you use to combine and calculate.

3. Click Next, then select one calculation from Function drop down list, and check other options as you need.

4. Click Finish to save the new workbook into a folder.
Now the sheets across workbooks have been consolidated and calculated into one sheet.

Comsolidate worksheets from workbooks into one sheet
Kutools for Excel: 300 functions you must have in Excel, 30-day free trial from here.
The Best Office Productivity Tools
Kutools for Excel Solves Most of Your Problems, and Increases Your Productivity by 80%
- Reuse: Quickly insert complex formulas, charts and anything that you have used before; Encrypt Cells with password; Create Mailing List and send emails...
- Super Formula Bar (easily edit multiple lines of text and formula); Reading Layout (easily read and edit large numbers of cells); Paste to Filtered Range...
- Merge Cells/Rows/Columns without losing Data; Split Cells Content; Combine Duplicate Rows/Columns... Prevent Duplicate Cells; Compare Ranges...
- Select Duplicate or Unique Rows; Select Blank Rows (all cells are empty); Super Find and Fuzzy Find in Many Workbooks; Random Select...
- Exact Copy Multiple Cells without changing formula reference; Auto Create References to Multiple Sheets; Insert Bullets, Check Boxes and more...
- Extract Text, Add Text, Remove by Position, Remove Space; Create and Print Paging Subtotals; Convert Between Cells Content and Comments...
- Super Filter (save and apply filter schemes to other sheets); Advanced Sort by month/week/day, frequency and more; Special Filter by bold, italic...
- Combine Workbooks and WorkSheets; Merge Tables based on key columns; Split Data into Multiple Sheets; Batch Convert xls, xlsx and PDF...
- More than 300 powerful features. Supports Office / Excel 2007-2021 and 365. Supports all languages. Easy deploying in your enterprise or organization. Full features 30-day free trial. 60-day money back guarantee.
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!
Sort comments by
#27070
This comment was minimized by the moderator on the site
0
0
#27071
This comment was minimized by the moderator on the site
Report
0
0
#28253
This comment was minimized by the moderator on the site
0
0
#30277
This comment was minimized by the moderator on the site
0
0
#30278
This comment was minimized by the moderator on the site
0
0
#33567
This comment was minimized by the moderator on the site
0
0
#34742
This comment was minimized by the moderator on the site
0
0
#36151
This comment was minimized by the moderator on the site
0
0
There are no comments posted here yet