メインコンテンツへスキップ

各ワークシートをExcelで個別の新しいブックとしてエクスポートして保存するにはどうすればよいですか?

XNUMXつまたは複数のワークシートを新しいワークブックとしてエクスポートして保存するとします。どのように処理しますか? 通常、各ワークシートをコピーして、新しいワークブックに貼り付けることができます。 しかし、ここでは、それに対処するためのいくつかの便利なトリックを紹介します。

[移動]または[コピー]コマンドを使用して、ワークシートを新しいブックとしてエクスポートおよび保存します

ワークシートをVBAコードを使用して新しいワークブックとしてエクスポートおよび保存します

Kutools for Excelを使用して、ワークシートを新しいワークブックとしてエクスポートおよび保存します 良いアイデア3


矢印青い右バブル [移動]または[コピー]コマンドを使用して、ワークシートを新しいブックとしてエクスポートおよび保存します

使い方 移動またはコピー コマンドを使用すると、XNUMXつまたは複数のワークシートを新しいブックにすばやくエクスポートまたはコピーできます。

ステップ1:タブバーでワークシート名を選択します。 押し続けると複数選択できます Ctrlキー キーまたは シフト キー。

ステップ2:ワークシート名を右クリックし、 移動またはコピー コンテキストメニューから。
ドキュメントエクスポートシート1

ステップ3:で 移動またはコピー ダイアログボックスで (新しい本) のドロップダウンリストからのアイテム 選択したシートを移動して予約する.

ドキュメントエクスポートシート2

ステップ4:次にクリック OK、これでに切り替えました 新しいワークブック エクスポートまたはコピーされたワークシートで、をクリックします File > Save 新しいワークブックを保存します。

注: 移動またはコピー ダイアログボックスには、 コピーを作成する オプション。 チェックしないと、選択したワークシートが元のブックから移動します。 チェックすると、選択したワークシートがコピーされます。


Excelで複数のワークシートを別々のブックにすばやく分割する

Microsoft Excelでは、このワークシートをコピーして新しいブックに貼り付けることにより、XNUMXつのブックのワークシートを新しいExcelファイルとして保存または分割できます。 大きなワークブックの各シート/ワークシートを個別のExcel、txt、csv、pdfファイルとして分割する場合は面倒なようです。 しかし、 Kutools for Excelさん 分割ワークブック ユーティリティ、あなたはすぐにそれに対処することができます。  フル機能を備えた 30 日間の無料トライアルを利用するには、ここをクリックしてください!
ドキュメント分割ワークブック1
 
Kutools for Excel:300を超える便利なExcelアドインがあり、30日以内に制限なしで無料で試すことができます。

矢印青い右バブル ワークシートをVBAコードを使用して新しいワークブックとしてエクスポートおよび保存します

次のコードは、表示されているすべてのワークシートを新しいブックにエクスポートし、元のシートの名前で、アクティブなブックと同じパスに新しく作成されたフォルダーにワークブックを保存します。 次の手順に従ってください。

ステップ1: Alt + F11 キー、そしてそれは開きます アプリケーション向け Microsoft Visual Basic 窓。

ステップ2:クリック インセット > モジュール、モジュールウィンドウに次のマクロを貼り付けます。

VBA:ワークシートを新しいブックとしてエクスポートして新しいフォルダーに保存します。

Sub SplitWorkbook()
'Updateby20200806
Dim FileExtStr As String
Dim FileFormatNum As Long
Dim xWs As Worksheet
Dim xWb As Workbook
Dim xNWb As Workbook
Dim FolderName As String
Application.ScreenUpdating = False
Set xWb = Application.ThisWorkbook

DateString = Format(Now, "yyyy-mm-dd hh-mm-ss")
FolderName = xWb.Path & "\" & xWb.Name & " " & DateString

If Val(Application.Version) < 12 Then
    FileExtStr = ".xls": FileFormatNum = -4143
Else
    Select Case xWb.FileFormat
        Case 51:
            FileExtStr = ".xlsx": FileFormatNum = 51
        Case 52:
            If Application.ActiveWorkbook.HasVBProject Then
                FileExtStr = ".xlsm": FileFormatNum = 52
            Else
                FileExtStr = ".xlsx": FileFormatNum = 51
            End If
        Case 56:
            FileExtStr = ".xls": FileFormatNum = 56
        Case Else:
            FileExtStr = ".xlsb": FileFormatNum = 50
        End Select
End If

MkDir FolderName

For Each xWs In xWb.Worksheets
On Error GoTo NErro
    If xWs.Visible = xlSheetVisible Then
    xWs.Select
    xWs.Copy
    xFile = FolderName & "\" & xWs.Name & FileExtStr
    Set xNWb = Application.Workbooks.Item(Application.Workbooks.Count)
    xNWb.SaveAs xFile, FileFormat:=FileFormatNum
    xNWb.Close False, xFile
    End If
NErro:
    xWb.Activate
Next

    MsgBox "You can find the files in " & FolderName
    Application.ScreenUpdating = True
End Sub

ステップ3: F5 このコードを実行するためのキー。 また、新しくエクスポートされたワークブックの場所を示すプロンプトボックスがポップアップ表示され、元のワークブックのすべてのワークシートが、新しい特定のフォルダー内の元のシートに名前を付けたいくつかの新しい個別のワークブックにエクスポートされました。 スクリーンショットを参照してください:

ドキュメントエクスポートシート7

矢印青い右バブル Kutools for Excelを使用して、ワークシートを新しいワークブックとしてエクスポートおよび保存します

複数のワークシートを個別のブックとして保存する必要がある場合、最初の方法は適切な選択ではありません。 また、VBAコードは、Excelの初心者にとっては少し複雑かもしれません。 ここでは、 分割ワークブック の有用性 Kutools for Excel XNUMXつのワークブックの各ワークシートをすばやく簡単にエクスポートして保存し、新しいワークブックを分離します。

Kutools for Excel, 以上で 300 便利な機能は、あなたの仕事をより簡単にします。 

無料インストール Kutools for Excel、以下のようにしてください:

ステップ1:クリック クツールズプラス > ワークブック > 分割ワークブック…。 スクリーンショットを参照してください:
ドキュメントエクスポートシート3

ステップ2: 分割ワークブック ダイアログボックスで、次のようにします。

ドキュメントエクスポートシート4
1: すべてのワークシート名はデフォルトでチェックされています。一部のワークシートを分割したくない場合は、チェックを外すことができます。


2: 非表示または空白のワークシートの分割を避けたい場合は、 非表示のワークシートをスキップする or 空白のワークシートをスキップする)。


3: そしてまたあなたはチェックすることができます 保存を指定します フォーマットし、シートの分割を選択して、テキストファイル、PDFファイル、またはcsvファイルとしてデフォルトで保存します。このオプションをオンにしないと、シートが分割され、ブックとして保存されます。

ステップ3:次にクリック スプリット ボタンをクリックし、新しいブックを配置するフォルダーを選択します。 スクリーンショットを参照してください:
ドキュメントエクスポートシート6

ステップ4:次にクリック OK、次に、チェックされた各ワークシート 分割ワークブック ダイアログボックスがエクスポートされ、個別のブックとして保存されます。 新しい各ワークブックには、元のワークシート名で名前が付けられます。 スクリーンショットを参照してください:
ドキュメントエクスポートシート5

この分割ワークブックツールの詳細については、ここをクリックしてください.

矢印青い右バブル 各シートを新しいワークブックとしてエクスポートして保存します


Excelの列または固定行に基づいてデータを複数のワークシートにすばやく分割する

列AからGにデータがあるワークシートがあり、セールスマンの名前が列Aにあり、同じワークブックの列Aに基づいてこのデータを複数のワークシートに自動的に分割する必要があり、各セールスマンは新しいワークシートに分割されます。ワークシート。 Kutools for Excelさん 分割日 ユーティリティは、Excelに表示されている以下のスクリーンショットのように、選択した列に基づいてデータを複数のワークシートにすばやく分割するのに役立ちます。  クリックすると、全機能を備えた 30 日間の無料トライアルが可能です。
ドキュメント分割データ2
 
Kutools for Excel:300を超える便利なExcelアドインがあり、30日以内に制限なしで無料で試すことができます。

関連記事:

最高のオフィス生産性向上ツール

🤖 Kutools AI アシスタント: 以下に基づいてデータ分析に革命をもたらします。 インテリジェントな実行   |  コードを生成  |  カスタム数式の作成  |  データを分析してグラフを生成する  |  Kutools関数を呼び出す...
人気の機能: 重複を検索、強調表示、または識別する   |  空白行を削除する   |  データを失わずに列またはセルを結合する   |   数式なしのラウンド ...
スーパールックアップ: 複数の基準の VLookup    複数の値の VLookup  |   複数のシートにわたる VLookup   |   ファジールックアップ ....
詳細ドロップダウン リスト: ドロップダウンリストを素早く作成する   |  依存関係のドロップダウン リスト   |  複数選択のドロップダウンリスト ....
列マネージャー: 特定の数の列を追加する  |  列の移動  |  Toggle 非表示列の表示ステータス  |  範囲と列の比較 ...
注目の機能: グリッドフォーカス   |  デザインビュー   |   ビッグフォーミュラバー    ワークブックとシートマネージャー   |  リソースライブラリ (自動テキスト)   |  日付ピッカー   |  ワークシートを組み合わせる   |  セルの暗号化/復号化    リストごとにメールを送信する   |  スーパーフィルター   |   特殊フィルター (太字/斜体/取り消し線をフィルター...) ...
上位 15 のツールセット12 テキスト ツール (テキストを追加, 文字を削除する、...)   |   50+ チャート 種類 (ガントチャート、...)   |   40+ 実用的 (誕生日に基づいて年齢を計算する、...)   |   19 挿入 ツール (QRコードを挿入, パスから画像を挿入、...)   |   12 変換 ツール (数字から言葉へ, 通貨の換算、...)   |   7 マージ&スプリット ツール (高度な結合行, 分割セル、...)   |   ... もっと

Kutools for Excel で Excel スキルを強化し、これまでにない効率を体験してください。 Kutools for Excelは、生産性を向上させ、時間を節約するための300以上の高度な機能を提供します。  最も必要な機能を入手するにはここをクリックしてください...

説明


Officeタブは、タブ付きのインターフェイスをOfficeにもたらし、作​​業をはるかに簡単にします

  • Word、Excel、PowerPointでタブ付きの編集と読み取りを有効にする、パブリッシャー、アクセス、Visioおよびプロジェクト。
  • 新しいウィンドウではなく、同じウィンドウの新しいタブで複数のドキュメントを開いて作成します。
  • 生産性を 50% 向上させ、毎日何百回もマウス クリックを減らすことができます!

Comments (63)
Rated 5 out of 5 · 1 ratings
This comment was minimized by the moderator on the site
Thanks, this was awesome. There are dozens of pages on the internet talking about how to do this. You guys are the only ones that got the VBA code right. Many thanks. I had a big monster workbook with about 100 tabs, all relatively small, and the VBA macro knocked it out in about five minutes. Thank God for smart guys like you. :)
Rated 5 out of 5
This comment was minimized by the moderator on the site
This has been extremely helpful, my job was doing some data management manually and this helped me automate it. I do have a question though, as the code is a bit over my head to figure out on my own.

What would I need to change to make it so that it always saves as a CSV file instead of an excel file? I know it'll be part of the IF VAL THEN CASES but I don't follow the formatting of that area.

Thank you,
Matt
This comment was minimized by the moderator on the site
Hi, Matt, I am glad that this article can help you. If you want to save sheets as new CSV files, this article https://www.extendoffice.com/documents/excel/5537-excel-batch-convert-to-csv.html lists the methods on exporting sheets as separated CSV files, hope it can do you a favor.
This comment was minimized by the moderator on the site
I have been using this VBA Code for some time and it worked like a charm until I changed computers. I have the same version of excel but now I am getting a Run Time Error "76" Path Not found. Any ideas what could be causing this? It looks like it is hanging up at MkDir. Any help you can provide is appreciated.
This comment was minimized by the moderator on the site
Hi, can I ask which office version you use?
This comment was minimized by the moderator on the site
I'm having this issue as well. I ran it once a month ago just fine and this came up just now.
This comment was minimized by the moderator on the site
You are amazing! Thank you so very much!
This comment was minimized by the moderator on the site
Thank you so much ! great and useful.
This comment was minimized by the moderator on the site
For Each xWs In xWb.Worksheets
How to do export only selected / grouped sheets to separate excel sheets by using this code.?
This comment was minimized by the moderator on the site
Hi there,

Keep getting a pop up that says 'compile error, invalid outside procedure' when i try and run the code. Any thoughts? Thanks for all your help.
This comment was minimized by the moderator on the site
Hi, Issybeee, I have update the VBA code in the tutorial, you can try the new one again.
This comment was minimized by the moderator on the site
For those of you who save macros in your "Personal.XLSB" or XLSTART (I see more questions below related to this), change the line

Set xWb = Application.ThisWorkbook to

Set xWB = ActiveWorkbook

That will make the macro run from the Active Workbook instead and save in a subfolder to that.
This comment was minimized by the moderator on the site
With the first method, if I hit F5, it opens a pop up window with the function "Go to". My excel is in spanish, im not sure if that is a factor. Any idea on how to fix it?
This comment was minimized by the moderator on the site
You can directly click the Run button of the Microsoft Visual Basic for Applications window.
This comment was minimized by the moderator on the site
Un aporte realmente útil. He probado el módulo con código VBA y funciona a la perfección. Muchas gracias, me has salvado una tarea que me hubiera llevado mucho tiempo con el mover y copiar.
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