Ir para o conteúdo principal

Como dividir uma pasta de trabalho para separar Excel arquivos em Excel?

Talvez seja necessário dividir uma pasta de trabalho grande para separar Excel arquivos salvando cada planilha da pasta de trabalho como um indivíduo Excel arquivo. Por exemplo, você pode dividir uma pasta de trabalho em vários Excel arquivos e, em seguida, entregar cada arquivo a uma pessoa diferente para lidar com ele. Ao fazer isso, você pode fazer com que certas pessoas lidem com dados específicos e mantê-los seguros. Este artigo apresentará maneiras de dividir uma pasta de trabalho grande em Excel arquivos com base em cada planilha.

  1. Dividir uma pasta de trabalho para separar Excel arquivos com copiar e colar
  2. Dividir uma pasta de trabalho para separar Excel Arquivos com recurso Mover ou Copiar
  3. Dividir uma pasta de trabalho para separar Excel arquivos com código VBA
  4. Dividir uma pasta de trabalho para separar Excel / PDF / CSV / TXT com Kutools for Excel facilmente

Dividir uma pasta de trabalho para separar Excel arquivos com copiar e colar

Normalmente, usando Copiar comando e macarrão comando pode salvar uma pasta de trabalho como separada Excel arquivo manualmente. Primeiramente, selecione toda a planilha que deseja salvar como um arquivo separado, crie uma nova pasta de trabalho e, em seguida, cole-a na nova pasta de trabalho e, no final, salve-a.

Esta é uma maneira fácil de usar se você precisar dividir apenas algumas planilhas como arquivos separados. No entanto, deve ser demorado e tedioso dividir muitas planilhas copiando e colando manualmente.


Dividir uma pasta de trabalho para separar Excel Arquivos com recurso Mover ou Copiar

Este método apresentará o recurso Mover ou Copiar para mover ou copiar as planilhas selecionadas para uma nova pasta de trabalho e salvar como uma pasta de trabalho separada. Faça o seguinte:

1. Selecione as folhas na barra da guia Folha, clique com o botão direito e selecione Mover ou Copiar no menu de contexto. Veja a imagem:

Anote os: Segurando Ctrl , você pode selecionar várias folhas não adjacentes clicando nelas uma a uma na barra da guia Folha; segurando mudança , você pode selecionar várias folhas adjacentes clicando na primeira e na última na barra da guia Folha.

2. Na caixa de diálogo Mover ou Copiar, selecione (livro novo) do Agendar lista suspensa, verifique o Crie uma cópia opção, e clique no botão OK botão. Veja a imagem:

3. Agora, todas as planilhas selecionadas são copiadas para uma nova pasta de trabalho. Clique Envie o > Salvar para salvar a nova pasta de trabalho.

Divida rapidamente uma pasta de trabalho para separar Excel /Arquivos PDF/TXT/CSV em Excel

Normalmente podemos dividir uma pasta de trabalho em Excel arquivos com o Mover ou Copiar recurso no Excel. Mas Kutools for Excel's Dividir a pasta de trabalho utilitário pode ajudá-lo a dividir facilmente uma pasta de trabalho e salvar cada planilha como um arquivo PDF/TEXT/CSV separado ou pasta de trabalho em Excel.


pasta de trabalho de divisão de anúncios excel

Kutools for Excel - Inclui mais de 300 ferramentas úteis para Excel. Avaliação gratuita completa de recursos 30-dia, sem necessidade de cartão de crédito! Get It Now

Dividir uma pasta de trabalho para separar Excel arquivos com código VBA

O código VBA a seguir pode ajudá-lo a dividir rapidamente várias planilhas da pasta de trabalho atual para separar Excel arquivos, faça o seguinte:

1. Crie uma nova pasta para a pasta de trabalho que deseja dividir, porque a divisão Excel os arquivos ficarão na mesma pasta desta pasta de trabalho mestre.

2. Segure o ALT + F11 chaves em Excel, e abre o Microsoft Visual Basic para Aplicações janela.

3. Clique inserção > Móduloe cole o código a seguir na janela do módulo.

VBA: divida uma pasta de trabalho em várias pastas de trabalho e salve na mesma pasta

Sub Splitbook()
'Updateby20140612
Dim xPath As String
xPath = Application.ActiveWorkbook.Path
Application.ScreenUpdating = False
Application.DisplayAlerts = False
For Each xWs In ThisWorkbook.Sheets
    xWs.Copy
    Application.ActiveWorkbook.SaveAs Filename:=xPath & "\" & xWs.Name & ".xlsx"
    Application.ActiveWorkbook.Close False
Next
Application.DisplayAlerts = True
Application.ScreenUpdating = True
End Sub

4. aperte o F5 chave para executar este código. E a pasta de trabalho é dividida em separado Excel arquivos na mesma pasta da pasta de trabalho original. Veja a captura de tela:

Anote os: Se uma das planilhas tiver o mesmo nome da pasta de trabalho, este VBA não funcionará.

Dividir uma pasta de trabalho para separar Excel / PDF / CSV / TXT com Kutools for Excel facilmente

Se você tem Kutools for Excel instalado, é Dividir a pasta de trabalho ferramenta pode dividir múltiplas planilhas como separadas Excel arquivos de forma conveniente e rápida com apenas alguns cliques.

Kutools for Excel - Inclui mais de 300 ferramentas úteis para Excel. Avaliação gratuita completa de recursos 30-dia, sem necessidade de cartão de crédito! Get It Now

1. Depois de instalar Kutools for Excel, clique em Kutools MAIS > Dividir a pasta de trabalho , veja a captura de tela:

2. No Dividir a pasta de trabalho caixa de diálogo, faça as seguintes operações:
(1) Todos os nomes de planilhas são verificados por padrão. Se não quiser dividir algumas das planilhas, você pode desmarcá-las;
(2) Verifique o Salvar um tipo opção;
(3) Do Salvar como tipo suspenso, escolha um tipo de arquivo que deseja dividir e salvar.
(4) Em seguida, clique Split botão.

Anote os: Se quiser evitar a divisão de planilhas ocultas ou em branco, você pode verificar o Pular planilhas ocultas or Pular planilhas em branco caixa.

3. Na caixa de diálogo Procurar pasta, especifique uma pasta de destino para salvar os arquivos separados divididos e clique no botão OK botão.

Agora, as planilhas marcadas são salvas como novas pastas de trabalho separadas. Cada nova pasta de trabalho é nomeada com o nome da planilha original. Veja a imagem:

Kutools for Excel's Dividir a pasta de trabalho ferramenta facilita a divisão da pasta de trabalho ativa em individuais Excel arquivos (um arquivo contém uma planilha), arquivos CSV, arquivos TXT ou arquivos PDF conforme necessário. Você pode configurar para pular todas as planilhas em branco e ocultas. Faça um teste grátis!


Demonstração: divida ou salve cada planilha de uma pasta de trabalho separadamente excel /txt/csv/arquivos pdf


Kutools for Excel inclui mais de 300 ferramentas úteis para Excel, grátis para testar sem limitação em 30 dias. Baixe e teste grátis agora!

Artigos relacionados:

Melhores ferramentas de produtividade de escritório

Turbine suas planilhas: Experimente eficiência como nunca antes com Kutools for Excel

Recursos mais comuns: Localizar/destacar/identificar duplicatas   |  Excluir linhas em branco   |  Combine colunas ou células sem perder dados   |   Rodada sem Fórmula ...
Super pesquisa: VLookup de múltiplos critérios    VLookup de múltiplos valores  |   VLookup em várias planilhas   |   Pesquisa Difusa ....
Lista suspensa avançada: Crie rapidamente uma lista suspensa   |  Lista suspensa de dependentes   |  Lista suspensa de seleção múltipla ....
Gerenciador de colunas: Adicione um número específico de colunas     Mover colunas   |   Exibir colunas   |   Comparar colunas com Selecionar células iguais e diferentes ...
Recursos em destaque: Foco da Grade   |  Vista de Design   |   Grande Barra de Fórmula    Gerenciador de pastas de trabalho e planilhas   |  Biblioteca (Auto texto)   |  Data Picker   |  Combinar planilhas   |  Criptografar/Descriptografar Células    Enviar e-mails por lista   |  Super Filtro   |   Filtro Especial (filtro negrito/itálico/tachado...) ...
15 principais conjuntos de ferramentas12 Texto Ferramentas (Adicionar texto, Remover Personagens, ...)   |   50+ de cores Tipos (Gráfico de Gantt, ...)   |   Mais de 40 práticos Fórmulas (Calcule a idade com base no aniversário, ...)   |   19 Inclusão Ferramentas (Insira o código QR, Inserir imagem do caminho, ...)   |   12 Conversão Ferramentas (Números para Words, Conversão de moedas, ...)   |   7 Unir e dividir Ferramentas (Combinar linhas avançadas, Dividir células, ...)   |   Muito mais...

Kutools for Excel possui mais de 300 recursos, garantindo que o que você precisa está a apenas um clique de distância...

Suporta Escritório/Excel 2007-2021 e mais recentes, incluindo 365 | Disponível em 44 idiomas | Desfrute de um teste gratuito de 30 dias com todos os recursos.

guia kte 201905


Office Tab Traz a interface com guias para o Office e torna seu trabalho muito mais fácil

  • Ative a edição e leitura com guias em Word, Excel, Power Point, Publisher, Access, Visio e Project.
  • Abra e crie vários documentos em novas guias da mesma janela, em vez de em novas janelas.
  • Aumenta sua produtividade em 50% e reduz centenas de cliques do mouse para você todos os dias!
Comments (113)
Rated 2.5 out of 5 · 1 ratings
This comment was minimized by the moderator on the site
Hello.
Both options work fine. But ..not satisfying my needs.
In each sheet i have 2 extra columns at and which contain vlookup formulas. And they all get exported to new files..
I cant have that.I also cant go and delete all formulas from all sheets then export , too much work.
Any solution to export but to ignore those columns with formulas?
Rated 2.5 out of 5
This comment was minimized by the moderator on the site
I tried this in Office 365 and it copies 8 sheets to separate files then gives me "run-time error '1004': Copy Method of Worksheet Class failed"
This comment was minimized by the moderator on the site
Hi there, did you use the vba code or Kutools?
This comment was minimized by the moderator on the site
I was able to use this macro once and it was great but now it will not work and I only get one file labeled as "Sheet 1" and it is blank, can anyone help?
This comment was minimized by the moderator on the site
Hello, how can we split the sheets tow by tow ==< what i mean is that i have an amount of sheets in one folder and I want tow split each tow successive sheets in one folder, i have tried to put changes on the basic code but i didn't succeed, I'm a beginner in this field if you can be held that is going to be a huge help
This comment was minimized by the moderator on the site
xWs.Copy
showing error in this area
This comment was minimized by the moderator on the site
Hello, I just tried the split data function based on the first column (about 90 partners). Half of the worksheets are named correctly while the other just have number of the sheet eventhough there is name of the partner in the column. Any help, please?
This comment was minimized by the moderator on the site
i have a data of 5 worksheets. Every worksheet has a common column (Branch). Can i convert the data into different excel files based on respective branches
This comment was minimized by the moderator on the site
Hi Sudarshan,
Kutools for Excel has an amazing feature – Split Data, which can quickly split data from a range or a sheet to multiple sheets based on values in the specified column. And these sheets are saved in a new workbook.

You can apply the Split Data feature to split each sheet based on the specified common column.
After splitting, you can apply the Combine Worksheets feature, also provided by Kutools for Excel, and combine all same name worksheets into one workbook.
This comment was minimized by the moderator on the site
excel which i want to split is having 3 spread sheet my requirement is to split the excel as per the sheet 1 and remaning to sheet to be contant when file split
This comment was minimized by the moderator on the site
Hi prateeksha,
In the fourth method on this webpage, the Split Workbook feature of Kutools for Excel is recommended, which will split every specified worksheet to individual PDF/CSV/TEXT/Workbooks.
This comment was minimized by the moderator on the site
Hey there,
I was wondering if we can use this macro to split the workbook into csv files
I've changed the VBA as below, replacing "xlsx" with "csv", but it doesn't work:
Application.ActiveWorkbook.SaveAs Filename:=xPath & "\" & xWs.Name & ".csv"
Thanks for your help!
This comment was minimized by the moderator on the site
Hi Kevin,
It recommends trying the fourth method to solve your problem. Kutools for Excel can be freely trial for 30 days. And the Split Workbook feature of Kutools for Excel can solve the problem easily.
This comment was minimized by the moderator on the site
Very helpful code. Just had one question. How can I make these excel files read-only. I tried the below but it did not work.

Application.ActiveWorkbook.ChangeFileAccess Mode:=xlReadOnly
This comment was minimized by the moderator on the site
Hello,
Thank you so much for this code. I have used it a few additions successfully many times. However it will no longer work. It saves one file with the name Sheet 1 and it is blank. Any assistance would be greatly appreciated. Thank you!
This comment was minimized by the moderator on the site
Were you able to resolve this? I have the same issue.
This comment was minimized by the moderator on the site
how can i undo it?
I mean i split all the sheets, worked on it and now I want all the sheets just like before. PL help
This comment was minimized by the moderator on the site
Wow. This is a very nice elaboration. you saved the day.
This comment was minimized by the moderator on the site
If I wanted to split the workbook's collection worksheets by fives into workbooks, is that possible? Meaning, If I have 100 worksheets in a workbook, I want to automate using 5 worksheets at a time to make a workbook, which will end with 20 workbooks being made. How do you tweak the code to do this?
This comment was minimized by the moderator on the site
VBA works. If not - Probable errors root cause: This VBA cannot handle HIDDEN SHEETS or if one of the sheets has the same name with the workbook.
This comment was minimized by the moderator on the site
Hi Gborka,
You can use the Split Workbook feature of Kutools for Excel, which can export hidden worksheets, and export all worksheets no matter what sheet names are.
This comment was minimized by the moderator on the site
Спасибо большое, всё работает.
This comment was minimized by the moderator on the site
Will this VBA work for Mac? It works perfectly for my PC but my manager uses a Mac.
This comment was minimized by the moderator on the site
Yes!! I just used it on Mac. However you will need to change some thing. The back slash into front slash /. I have already done it. Copy paste it. It will work. Let me know if it doesn't.

Sub Splitbook()
'Updateby20140612
Dim xPath As String
xPath = Application.ActiveWorkbook.Path
Application.ScreenUpdating = False
Application.DisplayAlerts = False
For Each xWs In ThisWorkbook.Sheets
xWs.Copy
Application.ActiveWorkbook.SaveAs Filename:=xPath & "/" & xWs.Name & ".xlsx"
Application.ActiveWorkbook.Close False
Next
Application.DisplayAlerts = True
Application.ScreenUpdating = True
End Sub
This comment was minimized by the moderator on the site
The version vba code is not working right, I have a "macros" file where I keep all my macros and have it open when I'm going to use them, and I'm running this one in the file that I need to be splitted but it splits the macros file.
This comment was minimized by the moderator on the site
Thank you!
This comment was minimized by the moderator on the site
I found this really help full. Thanks! :)
This comment was minimized by the moderator on the site
getting runtime error 1004
This comment was minimized by the moderator on the site
I am as well, I have used this several times in the past but it is not working now
This comment was minimized by the moderator on the site
1004 error root cause: This VBA cannot handle hidden sheets or if one of the sheets has the same name with the workbook.
This comment was minimized by the moderator on the site
Does anyone know how to make this code work for a mac?
It is showing an error when trying to locate the document.
This comment was minimized by the moderator on the site
Change "\" to "/" worked for me. Wow!
This comment was minimized by the moderator on the site
Amazing script and instructions. Just saved me from splitting 30+Worksheets to separate files
This comment was minimized by the moderator on the site
Same! This worked perfectly for me. Saved me a lot of effort. Thank you!
This comment was minimized by the moderator on the site
Please disregard my previous post. I have resolved my issue.
This comment was minimized by the moderator on the site
I am using the split data into worksheets based on a column with 27 items in that column. The results are 54 worksheets 2 for each item. The only difference I can see is based on one of the columns in the range. For example:

Once the split has occured, John Doe has 2 worksheets, one named John Doe and another named Sheet32. Each sheet has information for John Doe, but based on a column "Status" (Billed, Open Order, Salesforce), the information is split. The named worksheet has Billed & Open Order information and the Sheet32 has Salesforce information.


Any idea what I am doing wrong?
This comment was minimized by the moderator on the site
That really helped. Thank you.
This comment was minimized by the moderator on the site
With the addition of code from comment below it works realy nice.
This comment was minimized by the moderator on the site
Sub Splitbook()
'Updateby20140612
Dim xPath As String
Dim Sourcewb As Workbook
Dim Destwb As Workbook
Dim xWs As Worksheet


xPath = Application.ActiveWorkbook.Path
Set Sourcewb = ActiveWorkbook

With Application
.ScreenUpdating = False
.EnableEvents = False
.Calculation = xlCalculationManual
End With


' For Each xWs In ThisWorkbook.Sheets
For Each xWs In Sourcewb.Worksheets

If xWs.Visible = -1 Then
xWs.Copy
Set Destwb = ActiveWorkbook
If Destwb.Sheets(1).ProtectContents = False Then
With Destwb.Sheets(1).UsedRange
.Cells.Copy
.Cells.PasteSpecial xlPasteValues
.Cells(1).Select
End With
Application.CutCopyMode = False
End If
With Destwb
.SaveAs Filename:=xPath & "\" & xWs.Name & ".xlsx"
.Close False
End With
End If
Next

With Application
.ScreenUpdating = True
.EnableEvents = True
.Calculation = xlCalculationAutomatic
End With

MsgBox "You can find the files in " & xPath

End Sub
This comment was minimized by the moderator on the site
Hi, can I add or modify the filename?
This comment was minimized by the moderator on the site
Hi, can I get VBA to split a file with multiple tabs into separate files and save in their respective folders? i.e. If I have a report with 189 tabs each tab for different clients; can I separate those tabs and save each file in a folder specific to that client? The report varies with the number of tabs through out the month.
This comment was minimized by the moderator on the site
Hi - Can I get VBA to split a file with multiple tabs into files with multiple tabs? i.e. if I have a file with 2 tabs and data in both tabs with a field called customer -100 customers-, can I get VBA to create one file per customer -100 files- with two tabs each?
This comment was minimized by the moderator on the site
help ive done this loads of times however today its saying an error on the Application.ActiveWorkbook.SaveAs Filename:=xPath & "\" & xWs.Name & ".xlsx" what am i doing wrong
This comment was minimized by the moderator on the site
You may need to change ".xlsx" on line 9 to ".xls" instead
This comment was minimized by the moderator on the site
It does that because of the spaces for indentation on lines 8 - 10. Also kept me busy a while to figure out why it's doing that now.
This comment was minimized by the moderator on the site
been using this for a while and now having a run time error 1004 then highlighting in yellow line 8 xWs.copy any ideas please
This comment was minimized by the moderator on the site
Hi - instead of splitting each worksheet into a new workbook, is there a way to split groups of worksheets into new workbooks? Ex. Sheet1, Sheet2, Sheet3 go into a workbook, and Sheet4, Sheet5, and Sheet6 go to a second workbook, rather than six new workbooks?
This comment was minimized by the moderator on the site
need a vba code to copy an entire workbook (all tabs) and have files saved based on cell range name by state?
This comment was minimized by the moderator on the site
thank you very much http://www.extendoffice.com . very simple and well define post
This comment was minimized by the moderator on the site
Hi, I have a document of 10 sheets, but I only want the same 8 sheets to copy out each time I hit the command button. What changes can I make to the code (bearing in mind I am a complete amateur in Excel) to get each sheet to adopt the name of the main file, then add the sheet name at the end? So as an example the file is called "TESTING" and it has a sheet called "EUROPE". When the macro runs, I want the Europe sheet to be copied out and called "TESTING - EUROPE.xls".
This comment was minimized by the moderator on the site
Hi The coding works well but I want the header also to come on each and every sheet. As it's skipped the header in all data...
This comment was minimized by the moderator on the site
How can I get this .xlsx file to save as .csv when split?
This comment was minimized by the moderator on the site
Thank you so much! It worked after I unhid the rest of the workbook. This is awesome!
This comment was minimized by the moderator on the site
2 questions. 1. How can you adjust the code the choose the file path of where it is saved? As opposed to just saving wherever the original file is. 2. How do you change the code to choose what column it creates the tabs from (i.e. in this code it is reading out of column A). I want to be able to choose which column it reads off if. Thanks!
This comment was minimized by the moderator on the site
Thank you very much for this.Saved me weeks of sweat... Regards:Jessica Active consumer on customerso
This comment was minimized by the moderator on the site
Hi, i have one quarry i.e. i have 15000 lines of data in one excel sheet and i want to split that data into multiple excel files where as each file contains 99 lines of data. Anyone can help me. Please share your thoughts.....
This comment was minimized by the moderator on the site
This VBA code worked perfectly. Thank you for sharing your wealth of knowledge.
This comment was minimized by the moderator on the site
The macro should be updated to include an unhide-all-worksheets piece (including the very-hidden worksheets): Sub UnhideAllSheets() 'Unhide all sheets in workbook. Dim ws As Worksheet For Each ws In ActiveWorkbook.Worksheets ws.Visible = xlSheetVisible Next ws End Sub Sub Splitbook() 'Updateby20140612 Dim xPath As String xPath = Application.ActiveWorkbook.Path Application.ScreenUpdating = False Application.DisplayAlerts = False For Each xWs In ThisWorkbook.Sheets xWs.Copy Application.ActiveWorkbook.SaveAs Filename:=xPath & "\" & xWs.Name & ".xlsx" Application.ActiveWorkbook.Close False Next Application.DisplayAlerts = True Application.ScreenUpdating = True End Sub
This comment was minimized by the moderator on the site
IT SHOULD BE NOTED THAT THE VBA MACRO ABOVE WON'T WORK IF YOU HAVE A HIDDEN EXCEL SHEET, OR A "VERY-HIDDEN" EXCEL SHEET. YOU MAY NOT BE AWARE THAT YOU HAVE A "VERY-HIDDEN" EXCEL SHEET. TO CHECK, HIT ALT+F11 TO OPEN MICROSOFT VISUAL BASIC (MACRO EDITOR). CLICK ON EACH WORKSHEET UNDER THE MICROSOFT EXCEL OBJECTS AND MAKE SURE THAT THE "Visible" ATTRIBUTE IN THE "Properties" SECTION SHOWS "-1 = xlSheetVisible". IF YOU SPIT AN EXCEL FILE OUT OF ORACLE, FOR EXAMPLE, YOU'LL SEE A WORKSHEET NAMED "BneLog" with visibility = "2 - xlSheetVeryHidden". This took me forever to figure out, lol. Hope it helps!
This comment was minimized by the moderator on the site
Great tip! I was beating my head against a wall until this occurred to me. I saw previous comments about hidden sheets but until I realized an existing macro was "very hidden", it didn't make sense to me. On to the next project!
This comment was minimized by the moderator on the site
Used this and it worked. Just what I needed. Thanks
This comment was minimized by the moderator on the site
Hi I'm have master file were data consist for multiple city would like know is their any macros or any formula which keeps this orignal file and also create & update new workbook city area wise
This comment was minimized by the moderator on the site
Hello all, I need to reciprocate the same thing. there are lots of excel sheets and i want it te 1st sheet of it in single work book, Please Help!!!!
This comment was minimized by the moderator on the site
VBA script worked like a charm, got my 80+ new excel files
This comment was minimized by the moderator on the site
Hi All, I need a help from you all, I've to share the reports to multiple team depending on the brands they work for. Eg: brand name: Apple Samsung and many more around 60 brands. there will be a sales dump. If I want to run a macro, and spilt into multiple excel files what would be the procedure. Kindly help me. Thanks in Advance. Regards, Shan
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