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

Excelで複数の選択範囲または範囲をコピーするにはどうすればよいですか?

たとえば、大きなワークシートがあり、選択した範囲のみをコピーして他のワークシートに配布したいとします。 ただし、複数の範囲を選択して[コピー]をクリックすると、「そのコマンドは複数の選択で使用できません」というプロンプトダイアログボックスが表示されます。 この状態で、選択した複数の範囲をすばやくコピーするにはどうすればよいですか? このタスクを解決するための秘訣をいくつか紹介します。


クリップボードで選択した複数の範囲をコピーする

の助けを借りて、 クリップボード、選択したすべての範囲を一度に別の範囲またはワークシートに貼り付けることができます。 次のようにしてください。

1に設定します。 OK をクリックします。 ホーム > ドキュメントコピー複数の範囲09 セクションに クリップボード 表示するグループ クリップボード パン.。 スクリーンショットを参照してください:

2。 次に、必要な選択した範囲をXNUMXつずつコピーします。 同時に、コピーされた範囲はに表示されています クリップボード パン. 上記のスクリーンショットを参照してください。

3。 コピーしたすべての範囲を貼り付ける宛先範囲の最初のセルを選択し、をクリックします すべて貼り付け ボタンの クリップボード ペイン。

そして、コピーされたすべての範囲が指定された宛先範囲に貼り付けられました。

多くのワークシート/ワークブックからの複数の選択をXNUMXつのワークシート/ワークブックに簡単に組み合わせる

異なるワークブックの数十枚のシートをXNUMX枚のシートにまとめるのは面倒かもしれません。 しかし、Kutools forExcelの 組み合わせる(ワークシートとワークブック) ユーティリティ、あなたはそれを数回クリックするだけで成し遂げることができます!


広告コンバインシートブック1

Kutools for Excel - 300 以上の必須ツールで Excel を強化します。 クレジット カードは必要なく、全機能を備えた 30 日間の無料トライアルをお楽しみください。 今すぐ入手

選択した複数の範囲をVBAコードでコピーする

VBAコードを使用すると、選択した複数の範囲をコピーして、他のワークシートに貼り付けることもできます。

1。 ホールディング Ctrlキー キーを押して、使用する隣接していない複数の範囲を選択します。

2。 押す 他の + F11 同時にキーを開いて アプリケーション用のMicrosoftVisual Basic ウィンドウ、クリック インセット > モジュール、および次のコードをモジュールに入力します。

Option Explicit Sub CopyMultipleSelection()Dim SelAreas()As Range Dim PasteRange As Range Dim UpperLeft As Range Dim NumAreas As Integer、i As Integer Dim TopRow As Long、LeftCol As Integer Dim RowOffset As Long、ColOffset As Integer Dim NonEmptyCellCount As Integer'Exit範囲が選択されていない場合TypeName(Selection)<> "Range" Then MsgBox "コピーする範囲を選択します。複数選択が可能です。" Exit Sub End If '領域を個別の範囲オブジェクトとして格納しますNumAreas = Selection.Areas.Count ReDim SelAreas(1 To NumAreas)For i = 1 To NumAreas Set SelAreas(i)= Selection.Areas(i)Next'左上を決定します複数選択のセルTopRow = ActiveSheet.Rows.Count LeftCol = ActiveSheet.Columns.Count For i = 1 To NumAreas If SelAreas(i).Row <TopRow Then TopRow = SelAreas(i).Row If SelAreas(i).Column <LeftCol Then LeftCol = SelAreas(i).Column Next Set UpperLeft = Cells(TopRow、LeftCol) '貼り付けアドレスを取得エラー時に再開次の設定PasteRange = Application.InputBox _(Prompt:= "貼り付けの左上のセルを指定range: "、_ Title:=" Copy Mutliple Selection "、_ Type:= 8)On Error GoTo 0 'キャンセルされた場合は終了IfTypeName(PasteRange)<>" Range "Then ExitSub'左上のセルのみが使用済みSetPasteRange = PasteRange.Range( "A1") '既存のデータの貼り付け範囲を確認しますNonEmptyCellCount = 0 For i = 1 To NumAreas RowOffset = SelAreas(i).Row-TopRow ColOffset = Sel Areas(i).Column-LeftCol NonEmptyCellCount = NonEmptyCellCount + _ Application.CountA(Range(PasteRange.Offset(RowOffset、ColOffset)、_ PasteRange.Offset(RowOffset + SelAreas(i).Rows.Count-1、_ ColOffset + SelAreas (i).Columns.Count --1)))Next i '貼り付け範囲が空でない場合は、ユーザーに警告If NonEmptyCellCount <> 0 Then _ If MsgBox( "既存のデータを上書きしますか?"、vbQuestion + vbYesNo、_ "複数選択をコピー")<> vbYes Then Exit Sub '各領域をコピーして貼り付けますFori = 1 To NumAreas RowOffset = SelAreas(i).Row-TopRow ColOffset = SelAreas(i).Column-LeftCol SelAreas(i).Copy PasteRange.Offset( RowOffset、ColOffset)Next i End Sub

3。 次に、 ラン ボタンを押してコードを実行します。

4。 次に、セルを指定して、開口部に範囲を貼り付けてください 複数選択をコピー ダイアログボックスをクリックし、 OK ボタン。 スクリーンショットを参照してください:


XNUMXつのワークシートから選択した複数の範囲をすばやくコピーする

  複数の範囲をコピーする の有用性 Kutools for Excel アクティブなワークシートから複数の範囲をすばやく簡単にコピーするのに役立ちます。 次のようにしてください。

Kutools for Excel - 300 以上の必須ツールで Excel を強化します。 クレジット カードは必要なく、全機能を備えた 30 日間の無料トライアルをお楽しみください。 今すぐ入手

1。 を押さずに使用したい範囲をXNUMXつずつ選択します Ctrlキー キーを押してからクリックします クツール > コピー範囲。 スクリーンショットを参照してください:

2。 の中に 複数の範囲をコピーする ダイアログボックス、チェック すべて からのオプション 特別なペースト セクションを開き、 OK button。 上記のスクリーンショットを参照してください。

注: 行の高さと列の幅を元の範囲のままにしたい場合は、チェックしてください 行の高さを含む オプション 列幅を含む [複数の範囲をコピー]ダイアログボックスのオプション。

3。 次のプロンプトボックスに範囲を貼り付けるセルを指定して、[ OK

これで、選択したすべての範囲が、元の選択と同じ行の高さと列の幅として、指定したセルに貼り付けられます。

複数範囲のコピーユーティリティの詳細については、ここをクリックしてください       

Kutools for Excel - 300 以上の必須ツールで Excel を強化します。 クレジット カードは必要なく、全機能を備えた 30 日間の無料トライアルをお楽しみください。 今すぐ入手


多くのワークシート/ワークブックから複数の範囲をコピーする

Kutools forExcelは別のものを提供します ワークシートを組み合わせる Excelで多くのワークシートまたは多くのワークブックから複数の範囲を簡単にコピーするユーティリティ。 次のようにしてください。

Kutools for Excel - 300 以上の必須ツールで Excel を強化します。 クレジット カードは必要なく、全機能を備えた 30 日間の無料トライアルをお楽しみください。 今すぐ入手

1。 クリック クツールズプラス > 組み合わせる.

2. [ワークシートの結合–ステップ1/3]ダイアログボックスを開いて、[ ワークブックの複数のワークシートをXNUMXつのワークシートに結合します オプションをクリックし、 Next

3。 [ワークシートの結合–ステップ2/3]ダイアログボックスで、次のようにしてください。

(1)でワークブックを選択します ワークブックリスト セクションをクリックし、 ブラウズ 各ワークシートの後ろにあるボタンをクリックして、各ワークシートの範囲を指定します。
(2)をクリックします Add ボタンをクリックして、範囲をコピーする他のブックを追加し、上記(1)を繰り返して、追加したブックの範囲を指定します。
(3)をクリックします 終了

Kutools for Excel - 300 以上の必須ツールで Excel を強化します。 クレジット カードは必要なく、全機能を備えた 30 日間の無料トライアルをお楽しみください。 今すぐ入手

4。 次に、Kutools for Excelダイアログボックスが表示され、組み合わせシナリオの保存を要求されます。 クリックしてください 有り ボタンまたは いいえ 必要に応じてボタンを押します。

これまでのところ、複数のワークシートまたはワークブックから指定されたすべての範囲がコピーされ、新しいワークブックに貼り付けられています。


デモ:XNUMXつのワークシートから選択した複数の範囲をコピーする

デモ:多くのワークブック/ワークシートから選択した複数の範囲をコピーします


Kutools for Excel: 300 を超える便利なツールをすぐに利用できます。 機能制限なしの 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 (14)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Hi there,
Great code but wondered how I can paste values rather than just paste?
Thanks :)
This comment was minimized by the moderator on the site
Hi there,
Great post and the VBA code works perfectly. Is it possible to change the code to paste special > values? If so, how?
Thanks!
This comment was minimized by the moderator on the site
Hi. Nice code, works great. Is it possible to modify the code in a way such that it is possible to insert/paste the market row/ranges multiple times instead of just one time?
This comment was minimized by the moderator on the site
Hi Jacob,
Maybe this Insert Title Rows feature of Kutools for Excel can solve your problem.
https://www.extendoffice.com/product/kutools-for-excel/excel-insert-title-rows.html
This comment was minimized by the moderator on the site
Hi! How do I use the same VBA Code above but instead of simply pasting, I would like it to paste special for just the values. The table I am putting the values (constants) into is already formatted and with totals (formulas)
Thanks so much in advance!
This comment was minimized by the moderator on the site
Hi Katrina Manahan,

Please open the Microsoft Visual Basic for applications window, and create a new Module, just press CTRL + V to paste the VBA code directly. The sequence numbers before code won't be pasted.
This comment was minimized by the moderator on the site
Thanks for the code, works perfectly. This odd lack of function within Excel has stumped me many times in the past. It's normally quicker in the end to work around it, but in this case I have 4000 individually colour-coded cells so any work-around would have taken a long time, so I'm very grateful. Steve
This comment was minimized by the moderator on the site
Hi, Is it possible to adjust the code so that the copied cells can be pasted in another sheet? Now I get the error message "400" when I attempt this. I use Office 2010. Also, is it possible to copy so that empty lines are deleted? I have a big document and I copy some cells with hundreds of non-copied rows between them. This makes for a rather bulky output.
This comment was minimized by the moderator on the site
I found that if you have the Clipboard task plane open you can copy multiple rows simply using ctrl+C and paste them in order with crtl+V using Excel 2007.
This comment was minimized by the moderator on the site
Thank you SOOOOOO much - what a great site
This comment was minimized by the moderator on the site
Found above explanation of options to copy multiple ranges very helpful - thanks! I used the 'clipboard' option to copy multiple rows. Had to select each group of consecutive rows and copy it, move on and select next row or group of consecutive rows and copy it, etc.. But after this its easy, go to where you want to paste them, eg a new sheet, and click 'Paste all' from the Clipboard and all the rows are copied to there with out any gaps! Exactly what I wanted - thanks again!
This comment was minimized by the moderator on the site
I want to select the rows like 1, 5,6,10. so how can i copy these rows ???
This comment was minimized by the moderator on the site
In this case you can just select the rows and copy them as usual.
This comment was minimized by the moderator on the site
How can I copy cell a1, e5, g2, and so on.... (more than 1000 cells in same column) and paste them into b1, f5, h2 (right into the next column in same row.)
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations