Skip i'r prif gynnwys

Sut i uno neu gyfuno taflenni gwaith neu lyfrau gwaith yn un daflen waith?

Yn ein gwaith beunyddiol, efallai y byddwn yn dod ar draws problem sy'n uno cannoedd o daflenni neu lyfrau gwaith yn un ddalen ar gyfer dadansoddi data sy'n cymryd llawer o amser os ydych chi'n defnyddio'r gorchymyn Copi a Gludo yn Excel. Yma yn y tiwtorial hwn, byddaf yn darparu rhai awgrymiadau ar gyfer datrys y swydd hon yn gyflym.

doc cyfuno 1

CYFLEUSTER CYFLYM

Uno pob dalen o lyfr gwaith gweithredol yn un ddalen â VBA
Uno dwsinau o daflenni neu lyfrau gwaith yn un daflen waith / llyfr gwaith gyda chliciau
Uno dau dabl yn un a'u diweddaru gan golofn gyda chliciau
Dadlwythwch ffeil sampl


Uno pob dalen o lyfr gwaith gweithredol yn un ddalen â VBA

Yn yr adran hon, rwy'n darparu cod VBA a fydd yn creu taflen newydd i gasglu holl ddalenni'r llyfr gwaith gweithredol wrth i chi ei redeg.

1. Gweithredwch y llyfr gwaith rydych chi am gyfuno ei ddalennau i gyd, yna pwyswch + allweddi i agor Microsoft Visual Basic ar gyfer Ceisiadau ffenestr.

2. Yn popping window, cliciwch Mewnosod > Modiwlau i greu sgript Modiwl newydd.

3. Copïwch isod y cod a'u pastio i'r sgript.

Sub Combine()
'UpdatebyExtendoffice
Dim J As Integer
On Error Resume Next
Sheets(1).Select
Worksheets.Add
Sheets(1).Name = "Combined"
Sheets(2).Activate
Range("A1").EntireRow.Select
Selection.Copy Destination:=Sheets(1).Range("A1")
For J = 2 To Sheets.Count
Sheets(J).Activate
Range("A1").Select
Selection.CurrentRegion.Select
Selection.Offset(1, 0).Resize(Selection.Rows.Count - 1).Select
Selection.Copy Destination:=Sheets(1).Range("A65536").End(xlUp)(2)
Next
End Sub
doc cyfuno 2

4. Gwasgwch F5 yn allweddol, yna mae'r holl ddata ar draws taflenni wedi'u huno i mewn i ddalen newydd o'r enw Cyfun sy'n cael ei rhoi o flaen pob dalen.


ot symud

Ydych chi Am Gael Codi Tâl a Llawer o Amser i Gyfeilio i'r Teulu?

Mae Office Tab yn Gwella Eich Effeithlonrwydd 50% Yn Microsoft Office Working Right Now

Yn anghredadwy, mae gweithio mewn dwy ddogfen neu fwy yn haws ac yn gyflymach na gweithio mewn un.

O'i gymharu â phorwyr adnabyddus, mae'r offeryn tabbed yn Office Tab yn fwy pwerus ac yn fwy effeithlon.

Gostyngwch gannoedd o gliciau llygoden a theipio bysellfwrdd bob dydd i chi, ffarweliwch â llaw'r llygoden nawr.

Os ydych chi fel arfer yn gweithio ar sawl dogfen, bydd Office Tab yn arbed amser gwych i chi.

30- treial am ddim diwrnod, nid oes angen cerdyn credyd.

Darllenwch fwyAm ddim Lawrlwythwch Nawr


Uno dwsinau o daflenni neu lyfrau gwaith yn un daflen waith / llyfr gwaith gyda chliciau

Gyda'r VBA, dim ond taflenni yn y llyfr gwaith gweithredol y gallwch chi eu cyfuno, ond sut allwch chi uno taflenni ar draws llyfrau gwaith â thaflen neu lyfr gwaith?

Uno taflenni ar draws llyfrau gwaith yn un ddalen
doc cyfuno 18

Uno taflenni ar draws llyfrau gwaith yn un llyfr gwaith
doc cyfuno 3

Ar gyfer datrys y swydd hon a bodloni gofynion eraill ar gyfuno dalennau, mae'r Cyfunwch mae'r swyddogaeth wedi'i datblygu gyda phedwar senario cyfuniad:

  • Cyfunwch daflenni neu lyfrau gwaith lluosog yn un ddalen
  • Cyfunwch daflenni neu lyfrau gwaith lluosog yn un llyfr gwaith
  • Cyfunwch daflenni o'r un enw yn un ddalen
  • Cydgrynhoi gwerthoedd ar draws taflenni neu lyfrau gwaith yn un ddalen

Dyma gymryd yr ail opsiwn fel enghraifft:

Cyfunwch daflenni neu lyfrau gwaith lluosog yn un llyfr gwaith

Ar ôl gosod am ddim Kutools ar gyfer Excel, gwnewch fel isod:

1. Activate Excel, cliciwch Kutools Byd Gwaith > Cyfunwch, mae deialog yn ymddangos i'ch atgoffa bod angen cau'r llyfrau gwaith rydych chi am eu cyfuno. Cliciwch OK i barhau.
doc cyfuno 4
doc cyfuno 5

2. Yn y Cyfuno Taflenni Gwaith cam 1 deialog, gwirio Cyfuno nifer o daflenni gwaith o lyfrau gwaith yn un llyfr gwaith opsiwn. Cliciwch Digwyddiadau i fynd i gam nesaf y dewin.
doc cyfuno 6

3. Cliciwch Ychwanegu > Ffeil or Ffolder i ychwanegu'r llyfrau gwaith rydych chi am eu cyfuno i'r Rhestr llyfr gwaith cwarel, yna gallwch chi nodi pa daflen waith fydd yn cael ei chyfuno trwy wirio enwau i mewn Rhestr taflen waith cwarel. Cliciwch Digwyddiadau i fynd at gam olaf y dewin.
doc cyfuno 7

4. Yn y cam hwn, nodwch y gosodiadau yn ôl yr angen. Yna cliciwch Gorffen.
doc cyfuno 8

5. Mae ffenestr yn galw allan i chi ddewis ffolder i osod y llyfr gwaith cyfun, yna cliciwch Save.
doc cyfuno 9

Nawr mae'r llyfrau gwaith wedi'u huno yn un llyfr gwaith. Ac ar flaen pob dalen, crëir taflen feistr o'r enw Kutools ar gyfer Excel hefyd sy'n rhestru rhywfaint o wybodaeth am y taflenni a'r dolenni ar gyfer pob dalen.
doc cyfuno 10

Demo: Cyfuno taflenni / llyfrau gwaith yn un ddalen neu lyfr gwaith

Kutools ar gyfer Excel: 200 + offer defnyddiol defnyddiol, gan symleiddio'r tasgau cymhleth yn Excel i ychydig o gliciau.

Ffarwelio â Llaw Llygoden a Spondylosis Serfigol Nawr

Mae offer uwch 300 o Kutools ar gyfer Excel yn datrys 80% Tasgau Excel mewn eiliadau, tynnu chi allan o'r miloedd o llygoden-cliciau.

Deliwch yn hawdd â 1500 o senarios gwaith, nid oes angen gwastraffu amser ar gyfer chwilio atebion, cael llawer o amser i fwynhau'ch bywyd.

Gwella cynhyrchiant 80% ar gyfer 110000+ o bobl hynod effeithiol bob dydd, gan gynnwys eich cynnwys chi wrth gwrs.

Peidiwch â chael eich poenydio bellach gan fformiwlâu poenus a VBA, rhowch orffwys a hwyliau gweithio llawen i'ch ymennydd.

Treial 30 diwrnod am ddim gyda nodweddion llawn, arian 30 diwrnod yn ôl heb resymau.

Mae Corff Gwell yn Creu Bywyd Gwell.


Uno dau dabl yn un a'u diweddaru gan golofn gyda chliciau

Os ydych chi am uno dau dabl yn un a diweddaru data yn seiliedig ar golofn fel isod llun a ddangosir, gallwch roi cynnig ar y Uno Tablau cyfleustodau Kutools ar gyfer Excel.
doc cyfuno 11

Kutools ar gyfer Excel: mwy na 200 o ychwanegion Excel defnyddiol i symleiddio tasgau cymhleth i ychydig o gliciau yn Excel

Ar ôl gosod am ddim Kutools ar gyfer Excel, gwnewch fel isod:

1. Cliciwch Kutools Byd Gwaith > Uno Tablau i alluogi Uno Tablau dewin.
doc cyfuno 12

2. Yng ngham 1 y dewin, mae angen i chi ddewis y prif ystodau tabl ac edrych ar wahân. Yna cliciwch Digwyddiadau.
doc cyfuno 13

3. Gwiriwch y golofn allweddol rydych chi am ddiweddaru data yn y brif dabl yn seiliedig arni. Cliciwch Digwyddiadau.
doc cyfuno 14

4. Yna gwiriwch y colofnau yn y brif dabl rydych chi am ddiweddaru'r data yn seiliedig ar y tabl edrych. Cliciwch Digwyddiadau.
doc cyfuno 15

5. Yng ngham 4 y dewin, gwiriwch y colofnau rydych chi am eu hychwanegu o'r tabl edrych i'r prif dabl. Cliciwch Digwyddiadau.
doc cyfuno 16

6. Yng ngham olaf y dewin, nodwch yr opsiynau gosod yn ôl yr angen. Yna cliciwch Gorffen.
doc cyfuno 17

Nawr mae'r prif dabl wedi'i ddiweddaru'r data ac ychwanegu data newydd yn seiliedig ar y tabl edrych.

Demo: Cyfuno taflenni / llyfrau gwaith yn un ddalen neu lyfr gwaith

Kutools ar gyfer Excel: 200 + offer defnyddiol defnyddiol, gan symleiddio'r tasgau cymhleth yn Excel i ychydig o gliciau.


Dadlwythwch Ffeil Sampl

sampl


Offer Cynhyrchaeth a Argymhellir

Tab Office - Pori Tabiau, Golygu, Rheoli Dogfennau Yn Microsoft Office 2019 - 2003 Ac Office 365


tab swyddfa

Ychwanegiad Proffesiynol ar gyfer Cyflymu Excel 2019-2007, crebachu tasgau oriau i eiliadau

Mae'r ychwanegiad hwn yn cynnwys dwsinau o grwpiau proffesiynol, gyda 300+ opsiwn yn awtomeiddio'r rhan fwyaf o'ch tasgau dyddiol yn Excel, ac yn cynyddu eich cynhyrchiant o 50% o leiaf. Megis grwpiau o optonau un clic ac addasiadau swp.
Nawr dyma'ch cyfle i gyflymu'ch hun gyda Kutools ar gyfer Excel!


Comments (168)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Hi, I have a system that generates an excel file everyday. The daily file name is of format "<filename-12282021>". The 12282021 is the timestamp and it changes everyday creating a new excel file each day. I want to create a Master Workbook and then append the contents of the daily excel file into that master workbook. How can I automate it so it happens by itself everyday and the master file is update with contents of the daily file.   Thank you.
This comment was minimized by the moderator on the site
Hi rd2022, sorry that I have no idea to solve your problem so far. You can go to our forum https://www.extendoffice.com/forum/excel.html to leave this message, maybe some users have the same problem and has been solved.
This comment was minimized by the moderator on the site
In combining shhets I want to add one extra column in combined sheet as ShhetName
Can you suggest ?
This comment was minimized by the moderator on the site
The Combine function of Kutools for Excel can help you to insert sheet name in a new row of each combined range in the combined sheet by checking First row of each range (new row) in Insert worksheet information section in the last step of the Combine.
This comment was minimized by the moderator on the site
Hi - this function works well except my file has more than 900 sheets, and when I change the maximum number of rows (Loc 16, "A65536") to a higher number, the macro doesn't work. Is there a way to increase the number of rows that can be shown on the combine sheet?
This comment was minimized by the moderator on the site
The VBA code works fine but I want the data to be merged horizontally(side by side).
Hope you can help.
This comment was minimized by the moderator on the site
Hi,


Great Code and for the most part it works fantastically well.


Could I suggest creating a written tutorial for each line of code. I'd love to be able to play around with it to suit my Company's needs.

In the meantime however could you talk me through problems that would hinder this code from copying all data from each Sheet? I've noticed some sheets in my workbook aren't being copied at all.

To give you some context I'm dealing with roughly 330 sheets and they hold from 50 to 500 lines in each.


looking forward to hearing from you.
This comment was minimized by the moderator on the site
Hi, Daniel, I do not understand your question as you describe it not clearly, but if you have the Combine function in Excel, it can solve most of your question about combining sheets.
This comment was minimized by the moderator on the site
Hi,

Is it possible to only copy a particular range of cells for example A:4:FU38 from each sheet?


Also in the Combined sheet where the data is copied to, can the tab names from where the data is copied included in column A to enable lookups or to pivot the data?


Finally, can i specify the list of worksheets from which to copy the data across or maybe i can specify something like copy all worksheets to the left of a particular worksheet in the file.


Thanks in advance for your help
This comment was minimized by the moderator on the site
Hi, HS, you mean to combine same ranges from sheets into one sheet, it that right? If so, this article may help you: https://www.extendoffice.com/documents/excel/2754-excel-combine-ranges-from-different-worksheets-into-one.html#a3
This comment was minimized by the moderator on the site
This VBA code is an absolute lifesaver. Thank you!!
This comment was minimized by the moderator on the site
Hi. This code works well but I have the same problem as adj. The 1st row form each tab doesn't appear in the combined tab - except he first tab. Thanks
This comment was minimized by the moderator on the site
Just delete "Selection.Offset(1, 0).Resize(Selection.Rows.Count - 1).Select" from the code.

If you want to merge all rows from all worksheets, just use the code:

Sub Combine()

'UpdatebyExtendoffice

Dim J As Integer

On Error Resume Next

Sheets(1).Select

Worksheets.Add

Sheets(1).Name = "Combined"

Sheets(2).Activate

Range("A1").EntireRow.Select

Selection.Copy Destination:=Sheets(1).Range("A1")

For J = 2 To Sheets.Count

Sheets(J).Activate

Range("A1").Select

Selection.CurrentRegion.Select

Selection.Copy Destination:=Sheets(1).Range("A65536").End(xlUp)(2)

Next

End Sub
This comment was minimized by the moderator on the site
Yes, the code only can keep first row of the first tab, because it is used to consolidate, if you want to keep all contents of each sheet, you can try Combine utility of Kutools for Excel, it is free fior 60 days
This comment was minimized by the moderator on the site
i had a problem when I try to combine all same name worksheet to one worksheet, it works but some value are missing. so what should i do?
This comment was minimized by the moderator on the site
Hello, elok, did the problem appear while you applying Combine function? If so, please go to contact us to describe the problem with more details, our support will handle the problem for you.
This comment was minimized by the moderator on the site
Thanks that macro saved my day. I had over 40 sheets of data to combine into one and although my computer bogged for a minute or two, it completed without issue. The only modification I made was I tweaked the macro to start with A2 instead of A1 since A1 was my column headers.
This comment was minimized by the moderator on the site
Thanks for your support, Andrew, I am glad that the macro can help you.
There are no comments posted here yet
Load More
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations