Note: The other languages of the website are Google-translated. Back to English
Log på  \/ 
x
or
x
Tilmeld  \/ 
x

or

Hvordan kopieres flere ark flere gange i Excel?

Nogle gange kan det være nødvendigt at lave en kopi eller flere kopier af specificerede regneark i en projektmappe. Her er nogle hurtige måder at hjælpe dig med let at kopiere et regneark eller flere regneark flere gange i Excel.


Lav en kopi af flere regneark én gang til en aktiv projektmappe eller en anden projektmappe med kommandoen Flyt eller Kopi

Med Flyt eller Kopier kommando i Excel, kan du lave en kopi af et regneark, flere specifikke regneark eller alle regneark til en aktiv projektmappe eller en anden projektmappe ad gangen.

1. I den bestemte projektmappe, hvor du vil kopiere regneark, skal du vælge flere regneark på fanebladet Arkfane.
Bemærk: Holding CTRL nøgle, du kan vælge flere ikke-tilstødende arkfaner ved at klikke dem en efter en på arkfanen; holder SKIFT nøgle, kan du vælge flere tilstødende arkfaner ved at klikke på den første arkfane og den sidste på arkfanen.

2. Højreklik på den valgte fane på arkfanen, og vælg Flyt eller Kopier fra genvejsmenuen. Se skærmbillede:
dok kopi flere ark 01

3. I Flyt eller Kopier dialogboks, skal du angive følgende indstillinger:
(1) Angiv venligst destinationsmappen, du vil kopiere regneark til fra At reservere rulleliste. Du kan vælge den aktive projektmappe, en anden åben projektmappe eller en ny projektmappe, som du har brug for.
(2) Angiv placeringen af ​​de kopierede ark på arkfanen, du kan vælge efter alle de eksisterende ark.
(3) Kontroller Opret en kopi indstilling, hvis du ikke markerer denne indstilling, flyttes de valgte regneark til destinationsarbejdsmappen.
(4) Klik på OK .

Nu vil det kun lave en kopi af de valgte regneark i den angivne projektmappe. For at lave flere kopier af disse regneark kan du gentage handlingen flere gange.

Kun flere klik for at lave flere kopier af flere regneark i den aktive projektmappe

Generelt kan vi kopiere flere regneark med Flyt eller Kopier funktion i Excel. Denne funktion kan dog kun lave en kopi ad gangen. Her med Kutools til Excel Kopier regneark hjælpeprogram, kan du nemt lave så mange kopier af mange regneark, som du har brug for, i den aktive projektmappe kun ved flere klik. Komplet funktion Gratis prøveperiode 30 dage!
annonce kopi flere regneark 01

Kutools til Excel - Indeholder mere end 300 praktiske værktøjer til Excel. Fuld funktion gratis prøveperiode 30 dage, intet kreditkort krævet! Hent den nu

Lav flere kopier af et bestemt regneark til en aktiv projektmappe med VBA-kode

Hvis du vil lave 10 kopier af et bestemt regneark, vises Flyt eller Kopier kommando vil være en tidskrævende måde, og du skal gentage operationen mange gange. Men med den følgende VBA-kode kan du hurtigt kopiere regnearket 10 gange på én gang.

1. Hold nede ALT + F11 tasterne, og det åbner Microsoft Visual Basic til applikationer vindue.

2. Klik indsatte > Moduler, og indsæt følgende kode i modulvinduet.

VBA: Lav flere kopier af et bestemt regneark til en aktiv projektmappe

Sub Copier ()
Dim x As Integer
x = InputBox("Enter number of times to copy Sheet1")
For numtimes = 1 To x
ActiveWorkbook.Sheets("Sheet1").Copy _
After:=ActiveWorkbook.Sheets("Sheet1")
Next
End Sub

Bemærk: I ovenstående kode skal du erstatte "Sheet1"med navnet på det ark, der skal kopieres.

3. Tryk derefter på F5 nøgle til at køre koden, vises et promptfelt, der beder dig om antallet af arkkopier, du ønsker.

4. Klik derefter på OK, det angivne regneark er kopieret 100 gange i den aktive projektmappe.


Lav flere kopier af flere regneark til en aktiv projektmappe med Kutools til Excel

Selvom det er enkelt at lave en kopi af flere regneark i Excel, hvis du vil lave flere kopier af flere regneark i den aktuelle projektmappe, skal du muligvis bruge Flyt eller Kopier kommando element igen og igen. Ønsker du at få tingene gjort med et enkelt klik? Med Kopier regneark hjælpeprogrammet til tredjeparts-tilføjelsesprogrammet Kutools til Excel, kan du lave flere kopier af flere regneark med et enkelt klik i Excel.

Kutools til Excel - Indeholder mere end 300 praktiske værktøjer til Excel. Fuld funktion gratis prøveperiode 30 dage, intet kreditkort krævet! Hent den nu

1. Klik Kutools Plus > Kopier regneark. Se skærmbillede:

Bemærk: Klikker på Kutools Plus > Arbejdsark > Kopier regneark får også denne funktion.

2. Anvend indstillinger i Kopier flere regneark dialog boks:
(1) Kontroller de regneark, du vil kopiere fra Kopier de valgte regneark sektion.
(2) Specificer Antallet af kopier.
(3) Bestem placeringen af ​​de kopierede ark, f.eks. Før eller efter alle regneark, før eller efter det aktuelle regneark.
(4) Klik på Ok .

3. Der vises en hurtigboks for at minde dig om, at de afkrydsede regneark er blevet kopieret til flere gange efter behov, klik på OK for at afslutte den. Se skærmbillede:

Denne Kopier flere regneark træk ved Kutools til Excel laver flere kopier af flere specificerede regneark i den aktive projektmappe med kun flere klik. Få en gratis prøveperiode!


Lav en kopi af flere regneark fra flere projektmapper til en ny

Hvis du har installeret Kutools til Excel, kan du også anvende dens Kombiner regneark funktion til at lave en kopi af flere regneark fra flere lukkede projektmapper til en ny projektmappe med kun flere klik i Excel.

Kutools til Excel - Indeholder mere end 300 praktiske værktøjer til Excel. Fuld funktion gratis prøveperiode 30 dage, intet kreditkort krævet! Hent den nu

1. Klik Kutools Plus > Kombiner for at aktivere funktionen Kombiner regneark.

2. I guiden Kombiner regneark - Trin 1 af 3 skal du kontrollere Kombiner flere regneark fra projektmapper til et regneark valgmulighed, og klik på knappen Næste knap. Se skærmbillede:

3. I guiden Kombiner regneark - Trin 2 af 3 skal du gøre som følgende skærmbillede vist:
(1) Klik Tilføj > filet or Folder for at tilføje projektmapper, du vil kopiere regneark fra.
(2) I Liste over projektmapper sektion, tjek projektmappen, hvis regneark du vil kopiere;
(3) I Liste over regneark sektion, tjek de regneark, du vil kopiere;
(4) Gentag ovenfor (2) og sort (3) for at vælge regneark fra andre projektmapper, du vil kopiere.
(5) Klik på Næste .

4. I guiden Kombiner regneark - Trin 3 af 3 skal du konfigurere kopieringsindstillingerne efter behov, og klik på Finish .

5. Nu i den nye dialog skal du angive en destinationsmappe for at gemme den nye projektmappe, navngive den nye projektmappe i Filnavn boks og klik på Gem knap. Se skærmbillede:

Nu kommer yderligere to dialogbokse ud og beder dig om at åbne den nye projektmappe og gemme kombinationsscenariet. Klik venligst på knapperne efter behov. Indtil videre har den kopieret alle specificerede regneark fra flere projektmapper ad gangen.

Med dette Kombiner (regneark) værktøj, kan du nemt kopiere og kombinere regneark og projektmapper som vist på nedenstående liste. Få en gratis prøveperiode!
(1) Kombiner hurtigt flere regneark / intervaller fra projektmapper til et regneark;
(2) Flet / kombiner hurtigt alle regneark med samme navn på tværs af projektmapper til et regneark;
(3) Hurtigt flet / kombiner regneark eller projektmapper i en projektmappe;
(4) Opsummer / beregn hurtigt data fra flere regneark til et regneark.


De bedste Office-produktivitetsværktøjer

Kutools til Excel løser de fleste af dine problemer og øger din produktivitet med 80%

  • Genbruge: Indsæt hurtigt komplekse formler, diagrammer og alt, hvad du har brugt før; Krypter celler med adgangskode Opret postliste og send e-mails ...
  • Super Formula Bar (let redigere flere linjer med tekst og formel); Læsning Layout (let at læse og redigere et stort antal celler); Indsæt til filtreret rækkevidde...
  • Flet celler / rækker / kolonner uden at miste data; Split celler indhold; Kombiner duplikerede rækker / kolonner... Forhindre duplikerede celler; Sammenlign områder...
  • Vælg Duplicate eller Unique Rækker; Vælg tomme rækker (alle celler er tomme); Super Find og Fuzzy Find i mange arbejdsbøger; Tilfældig valg ...
  • Præcis kopi Flere celler uden at ændre formelreference; Auto Opret referencer til flere ark; Indsæt kugler, Afkrydsningsfelter og mere ...
  • Uddrag tekst, Tilføj tekst, Fjern efter position, Fjern mellemrum; Opret og udskriv personsøgningssubtotaler; Konverter mellem celler indhold og kommentarer...
  • Superfilter (gem og anvend filterskemaer på andre ark); Avanceret sortering efter måned / uge / dag, hyppighed og mere; Specielt filter af fed, kursiv ...
  • Kombiner arbejdsbøger og arbejdsark; Fletabeller baseret på nøglekolonner; Opdel data i flere ark; Batch Konverter xls, xlsx og PDF...
  • Mere end 300 kraftfulde funktioner. Understøtter Office / Excel 2007-2019 og 365. Understøtter alle sprog. Nem implementering i din virksomhed eller organisation. Fuld funktioner 30-dages gratis prøveperiode. 60-dages pengene tilbage garanti.
kte-fane 201905

Fanen Office bringer en grænseflade til et kontor med Office, og gør dit arbejde meget lettere

  • Aktiver redigering og læsning af faner i Word, Excel, PowerPoint, Publisher, Access, Visio og Project.
  • Åbn og opret flere dokumenter i nye faner i det samme vindue snarere end i nye vinduer.
  • Øger din produktivitet med 50% og reducerer hundredvis af museklik for dig hver dag!
officetab bund
Say something here...
symbols left.
You are guest
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.
    Tyler Dempsey · 3 years ago
    I am new to this I am just trying to make copies of the same sheet this is the code I am using.

    Sub Copier()
    Dim s As String
    Dim numtimes As Integer
    Dim numCopies As Integer
    numCopies = InputBox("How many copies do you need?")
    s = InputBox("Enter the name of the Worksheet you want to copy")
    For numtimes = 1 To numCopies
    ActiveWorkbook.Sheets(s).Copy _
    After:=ActiveWorkbook.Sheets(Worksheets.Cou nt)
    Next
    End Sub

    when i use the code it gives me the error of "Syntax Error" then this text turns red ActiveWorkbook.Sheets(s).Copy _
    After:=ActiveWorkbook.Sheets(Worksheets.Cou nt) and the is text turns yellow Sub Copier() what can i do to fix it.
    • To post as a guest, your comment is unpublished.
      Jorge · 1 years ago
      Working Code

      Sub Copier()
      Dim s As String
      Dim numtimes As Integer
      Dim numCopies As Integer
      numCopies = InputBox("How many copies do you need?")
      s = InputBox("Enter the name of the Worksheet you want to copy")
      For numtimes = 1 To numCopies
      ActiveWorkbook.Sheets(s).Copy After:=ActiveWorkbook.Sheets(Worksheets.Count)
      Next
      End Sub

      copy the entire line from ActiveWorkbook.Sheets...... that was the problem, and some spaces

      Have a great day
    • To post as a guest, your comment is unpublished.
      Schuyler · 3 years ago
      [quote name="Tyler Dempsey"]I am new to this I am just trying to make copies of the same sheet this is the code I am using.

      Sub Copier()
      Dim s As String
      Dim numtimes As Integer
      Dim numCopies As Integer
      numCopies = InputBox("How many copies do you need?")
      s = InputBox("Enter the name of the Worksheet you want to copy")
      For numtimes = 1 To numCopies
      ActiveWorkbook.Sheets(s).Copy _
      After:=ActiveWorkbook.Sheets(Worksheets.Cou nt)
      Next
      End Sub

      when i use the code it gives me the error of "Syntax Error" then this text turns red ActiveWorkbook.Sheets(s).Copy _
      After:=ActiveWorkbook.Sheets(Worksheets.Cou nt) and the is text turns yellow Sub Copier() what can i do to fix it.[/quote]


      Here is the exact code you want to use:


      Sub Copier()
      Dim s As String
      Dim numtimes As Integer
      Dim numCopies As Integer
      numCopies = InputBox("How many copies do you need?")
      s = InputBox("Enter the name of the Worksheet you want to copy")
      For numtimes = 1 To numCopies
      ActiveWorkbook.Sheets(s).Copy _
      After:=ActiveWorkbook.Sheets(Worksheets.Count)
      Next
      End Sub
      • To post as a guest, your comment is unpublished.
        Belva · 2 months ago
        Thank you, the last one saved my life :)
    • To post as a guest, your comment is unpublished.
      Schuyler · 3 years ago
      [quote name="Tyler Dempsey"]I am new to this I am just trying to make copies of the same sheet this is the code I am using.

      Sub Copier()
      Dim s As String
      Dim numtimes As Integer
      Dim numCopies As Integer
      numCopies = InputBox("How many copies do you need?")
      s = InputBox("Enter the name of the Worksheet you want to copy")
      For numtimes = 1 To numCopies
      ActiveWorkbook.Sheets(s).Copy _
      After:=ActiveWorkbook.Sheets(Worksheets.Cou nt)
      Next
      End Sub

      when i use the code it gives me the error of "Syntax Error" then this text turns red ActiveWorkbook.Sheets(s).Copy _
      After:=ActiveWorkbook.Sheets(Worksheets.Cou nt) and the is text turns yellow Sub Copier() what can i do to fix it.[/quote]


      Double check your code and make sure you don't have a space at ActiveWorkbook. Sheets(s).Copy _ or at Sheets(Worksheets.Cou nt)
  • To post as a guest, your comment is unpublished.
    Simon · 4 years ago
    Fantastic VBA code - really helped
  • To post as a guest, your comment is unpublished.
    Barry · 4 years ago
    When I first tried it, I got the error message because I didn't change the name Sheet1. After I realized what caused the error, I researched a little further, as I did not want to be manually entering the sheet name into the macro. And when I need this feature, it is almost always for the current sheet.

    I added the line a = activesheet.name
    And revised the line after:=activeworkbook.sheets("sheet1") to activeworkbook.sheets(a).copy _

    That worked very well, but I did notice the numbering was reversed ... that didn't bother me as I was going to manually rename the new sheets anyway.

    When I saw Schuyler's post, I further revised the line activeworkbook.sheets(a).copy _ to after:=activeworkbook.sheets(worksheets.count)

    I am now satisfied with the result. My finished macro:

    Sub copies()
    Dim x As Integer
    x = InputBox("Enter number of times to copy Sheet1")
    For numtimes = 1 To x
    ActiveWorkbook.Sheets("Sheet1").Copy _
    After:=ActiveWorkbook.Sheets(Worksheets.Count)
    Next
    End Sub

    ---
    All the best, Barry
    • To post as a guest, your comment is unpublished.
      MJ · 2 years ago
      i got syntax error on "After:=ActiveWorkbook.Sheets(Worksheets.Count)


      but i dunno whats wrong... Can u help me please?
    • To post as a guest, your comment is unpublished.
      Kate · 3 years ago
      Thank you so much Barry. Your finished macro is the only thing that worked for me.
  • To post as a guest, your comment is unpublished.
    stalag 17 · 4 years ago
    where i will insert this above code in vba should i create common button then inside ?? regards.
    • To post as a guest, your comment is unpublished.
      Adi · 3 years ago
      Follow the below steps:
      1. Copy the above code
      2. 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.
      4.Then press F5 key to run the code
      5.A prompt box appears to ask you the number of sheet copies you want.
  • To post as a guest, your comment is unpublished.
    Susan · 5 years ago
    I get an error that 'numtimes' is not defined...?
  • To post as a guest, your comment is unpublished.
    Debbi · 5 years ago
    I got the same error as Theou and no one seems to have addressed it. My tabs are already named PO 51, PO 52, etc. and I replaced Sheet1 with PO 51 to copy that and got the subscript error out of range (9)

    I followed Schuyler's code to get the right order, but I still get the error and it's always due to these two lines:

    ActiveWorkbook.Sheets(s).Copy _
    Before:=ActiveWorkbook.Sheets(Worksheets.Count)
    • To post as a guest, your comment is unpublished.
      Schuyler · 5 years ago
      [quote name="Debbi"]I got the same error as Theou and no one seems to have addressed it. My tabs are already named PO 51, PO 52, etc. and I replaced Sheet1 with PO 51 to copy that and got the subscript error out of range (9)

      I followed Schuyler's code to get the right order, but I still get the error and it's always due to these two lines:

      ActiveWorkbook.Sheets(s).Copy _
      Before:=ActiveWorkbook.Sheets(Worksheets.Count)[/quote]

      Can you include your complete code to make it easier to debug? A "subscript error out of range" usually means that the code references something that doesn't exist. I find this in my own code when I've got a typo or something of that nature.
  • To post as a guest, your comment is unpublished.
    Roy · 5 years ago
    how to copy with same column widths
    • To post as a guest, your comment is unpublished.
      Schuyler · 5 years ago
      Same column widths as the original Worksheet or do you want all of the column widths to be the same?
  • To post as a guest, your comment is unpublished.
    sadaqat · 5 years ago
    yes it works thanks I have successfully make multiple copies of a single worksheet in same workbook by using vba code thnx a lot.
  • To post as a guest, your comment is unpublished.
    Gopal Krishan · 5 years ago
    Search for word "After" and change it to "Before". This will create copies in right order "Before" Sheet1. The only thing to rememeber is that numbering will always start from (2) as the original sheet will always be counted as 1st copy. Also you can replace "Sheet1" with name of the tab you are trying to copy.
  • To post as a guest, your comment is unpublished.
    juan · 6 years ago
    [quote name="MichaelTadashi"]Using the VBA code, the naming of the duplicated worksheets is in reverse order. Let's say I make 10 copies of Sheet1, I'll end up with Sheet1, Sheet1(10), Sheet1(9), Sheet1(8),.......is it possible to have them in normal order?[/quote]

    Anyone was able to answer this question? I need to create 72 copies, but it would be needed to have them in order (1 throught 72, intead of 72 through 1)

    Thanks!
    • To post as a guest, your comment is unpublished.
      Schuyler · 5 years ago
      [quote name="juan"][quote name="MichaelTadashi"]Using the VBA code, the naming of the duplicated worksheets is in reverse order. Let's say I make 10 copies of Sheet1, I'll end up with Sheet1, Sheet1(10), Sheet1(9), Sheet1(8),.......is it possible to have them in normal order?[/quote]

      Anyone was able to answer this question? I need to create 72 copies, but it would be needed to have them in order (1 throught 72, intead of 72 through 1)

      Thanks![/quote]

      If you want the sheet copies to be in sequential order instead of backwards, change the following line...

      [i]After:=ActiveWorkbook.Sheets[/i][u]("Sheet1")[/u]

      to this...

      [i]After:=ActiveWorkbook.Sheets[/i][u](Worksheets.Count)[/u]

      My completed code looked like the following which uses 2 InputBox prompts to allow for a dynamic copy count and worksheet name..


      [i]Sub Copier()
      Dim s As String
      Dim numtimes As Integer
      Dim numCopies As Integer
      numCopies = InputBox("How many copies do you need?")
      s = InputBox("Enter the name of the Worksheet you want to copy")
      For numtimes = 1 To numCopies
      ActiveWorkbook.Sheets(s).Copy _
      After:=ActiveWorkbook.Sheets(Worksheets.Count)
      Next
      End Sub[/i]
      • To post as a guest, your comment is unpublished.
        Karsten · 4 years ago
        How do i get the coppies continuous numbered. If the sheet i want to copy is named I002, and i want the next to be named I003,I004,I005 an so on.
  • To post as a guest, your comment is unpublished.
    Lim · 6 years ago
    Wow, thanks for the VBA code. It really helps a lot!
  • To post as a guest, your comment is unpublished.
    Dee · 6 years ago
    thanks, the vba code was huge
  • To post as a guest, your comment is unpublished.
    Theou Aegis · 6 years ago
    I tried the VBA code and got subscript out of range error (9). I replaced the sheet name with anything I could think of that was in the workbook already. Any idea what I did wrong?

    Also, is there a way to make it name each sheet incrementally? This would tie in with Michael's question, I'm sure. I'm guessing the answer to his question would be you'd need to set the After target to "sheet"+x somehow and that in turn would apply to my question if there was a way to specify what to name the new sheet. I could always just change my boss' "master" to "Aug 0" or whatever month it is, but it'd be easier for her to understand if the script did the naming automatically.
  • To post as a guest, your comment is unpublished.
    MichaelTadashi · 7 years ago
    Using the VBA code, the naming of the duplicated worksheets is in reverse order. Let's say I make 10 copies of Sheet1, I'll end up with Sheet1, Sheet1(10), Sheet1(9), Sheet1(8),.......is it possible to have them in normal order?