跳到主要内容

如何在Excel中复制多个选择或范围?

例如,您有一个很大的工作表,现在您只想复制一些选定范围并分发到其他工作表。 但是,当您选择多个范围并单击“复制”时,将出现一个提示对话框,提醒您“该命令不能用于多个选择。” 在这种情况下,如何快速复制多个选定范围? 这里有一些技巧可以帮助您解决此任务。


使用剪贴板复制多个选定范围

的帮助下 剪贴板,您可以一次将所有选定范围粘贴到另一个范围或工作表。 请执行以下操作:

1。 点击 主页 > doc复制多个范围09 ,在 剪贴板 组以显示 剪贴板 面包.。 看截图:

2。 然后一一复制所需的选定范围。 同时,复制的范围已出现在 剪贴板 面包. 参见上面的截图:

3。 选择将所有复制的范围粘贴到的目标范围的第一个单元格,然后单击 全部粘贴 按钮在 剪贴板 窗格。

然后,所有复制的范围都已粘贴到指定的目标范围中。

轻松地将多个工作表/工作簿中的多个选择组合到单个工作表/工作簿中

将不同工作簿中的数十张工作表合并到一张工作表中可能会很乏味。但是使用 Kutools for Excel 合并(工作表和工作簿) 实用程序,只需单击几下就可以完成!


广告组合床单书1

Kutools for Excel - 使用 300 多种基本工具增强 Excel 功能。 享受全功能 30 天免费试用,无需信用卡! 立即行动吧!

使用VBA代码复制多个选定范围

使用VBA代码,您还可以复制多个选定范围并将其粘贴到任何其他工作表中。

1。 拿着 按Ctrl 键,然后选择要使用的多个非相邻范围。

2。 按 其他 + F11 按键同时打开 适用于应用程序的Microsoft Visual Basic 窗口中,单击 插页 > 模块,然后将以下代码输入到模块中:

选项显式子CopyMultipleSelection()Dim SelAreas()作为范围Dim PasteRange作为范围Dim UpperLeft作为范围Dim NumAreas作为整数,我作为Integer Dim TopRow如长,LeftCol作为整数Dim RowOffset如长,ColOffset如整数Dim NonEmptyCellCount如整数如果未选择范围,则如果TypeName(Selection)<>“ Range”,则MsgBox“选择要复制的范围。允许多项选择。” 退出子结束如果'将区域存储为单独的范围对象,则NumAreas = Selection.Areas.Count ReDim SelAreas(1到NumAreas)对于i = 1到NumAreas设置SelAreas(i)= Selection.Areas(i)Next'确定左上角多个选择中的单元格TopRow = ActiveSheet.Rows.Count LeftCol = ActiveSheet.Columns.Count对于i = 1到NumAreas如果SelAreas(i).Row <TopRow然后TopRow = SelAreas(i).Row如果SelAreas(i).Column <LeftCol然后LeftCol = SelAreas(i)。列Next Set UpperLeft = Cells(TopRow,LeftCol)'在错误继续时获取粘贴地址Next Set PasteRange = Application.InputBox _(Prompt:=“请指定粘贴的左上单元格范围:“,_标题:=”复制多重选择“,_类型:= 8)发生错误时GoTo 0'如果取消,则退出如果TypeName(PasteRange)<>” Range“然后退出Sub'确保仅左上方的单元格使用的Set PasteRange = PasteRange.Range(“ A1”)'检查现有数据的粘贴范围NonEmptyCellCount = 0对于i = 1到NumAreas RowOffset = SelAreas(i)。行-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)))接下来的i'如果粘贴范围不为空,则警告用户If NonEmptyCellCount <> 0则_如果MsgBox(“是否覆盖现有数据?”,vbQuestion + vbYesNo,_“复制多个选择“)<> vbYes然后退出Sub'复制并粘贴每个区域,对于i = 1到NumAreas RowOffset = SelAreas(i)。行-TopRow ColOffset = SelAreas(i)。列-LeftCol SelAreas(i).Copy PasteRange.Offset( RowOffset,ColOffset)下一个i End Sub

3。 然后点击 运行 按钮运行代码。

4。 现在,请指定一个单元格以将范围粘贴到开头 复制多项选择 对话框,然后单击 OK 按钮。 看截图:


从一个工作表中快速复制多个选定范围

复制多个范围 实用程序 Kutools for Excel 可以帮助您轻松快速地从活动工作表中复制多个范围。 请执行以下操作:

Kutools for Excel - 使用 300 多种基本工具增强 Excel 功能。 享受全功能 30 天免费试用,无需信用卡! 立即行动吧!

1。 选择要一一使用的范围,而无需按住 按Ctrl 键,然后单击 库工具 > 复制范围。 看截图:

2。 在 复制多个范围 对话框,检查 所有类型 选项 特殊粘贴 部分,然后单击 好吧b乌顿。 参见上面的截图:

请注意: 如果要将行高和列宽保持在原始范围内,请检查 包括行高 选项和 包括列宽 复制多个范围对话框中的选项。

3。 并在以下提示框中指定一个单元格以粘贴范围,然后单击 OK 按钮。

现在,所有选定范围都将粘贴到指定单元格中,其行高和列宽与原始选择的行高和列宽相同。

单击此处,了解有关“复制多个范围”实用程序的更多信息。       

Kutools for Excel - 使用 300 多种基本工具增强 Excel 功能。 享受全功能 30 天免费试用,无需信用卡! 立即行动吧!


从许多工作表/工作簿中复制多个范围

Kutools for Excel 提供了另一种 合并工作表 该实用程序可在Excel中轻松地从多个工作表或多个工作簿中复制多个范围。 请执行以下操作:

Kutools for Excel - 使用 300 多种基本工具增强 Excel 功能。 享受全功能 30 天免费试用,无需信用卡! 立即行动吧!

1。 点击 Kutools 加 > 结合.

2.在打开的合并工作表–第1步,共3对话框中,请检查 将工作簿中的多个工作表合并为一个工作表 选项,然后单击 下一页 按钮。

3。 在“合并工作表–第2步,共3步”对话框中,请执行以下操作:

(1)在 工作簿清单 部分,然后单击 浏览 每个工作表后面的按钮以指定每个工作表的范围;
(2)点击 地址 按钮添加要从中复制范围的其他工作簿,然后重复上述(1)以在添加的工作簿中指定范围。
(3)点击 完成 按钮。

Kutools for Excel - 使用 300 多种基本工具增强 Excel 功能。 享受全功能 30 天免费试用,无需信用卡! 立即行动吧!

4。然后出现一个 Kutools for excel 对话框,要求保存组合场景。请点击 按钮或 没有 按钮,根据需要。

到目前为止,已复制多个工作表或工作簿中的所有指定范围,并将其粘贴到新工作簿中。


演示:从一个工作表中复制多个选定范围

演示:从许多工作簿/工作表中复制多个选定范围


Kutools for Excel:超过 300 个方便的工具触手可及! 立即开始 30 天免费试用,没有任何功能限制。 立即下载!

最佳办公生产力工具

🤖 Kutools 人工智能助手:基于以下内容彻底改变数据分析: 智能执行   |  生成代码  |  创建自定义公式  |  分析数据并生成图表  |  调用 Kutools 函数...
热门特色: 查找、突出显示或识别重复项   |  删除空白行   |  合并列或单元格而不丢失数据   |   不使用公式进行四舍五入 ...
超级查询: 多条件VLookup    多值VLookup  |   跨多个工作表的 VLookup   |   模糊查询 ....
高级下拉列表: 快速创建下拉列表   |  依赖下拉列表   |  多选下拉列表 ....
列管理器: 添加特定数量的列  |  移动列  |  切换隐藏列的可见性状态  |  比较范围和列 ...
特色功能: 网格焦点   |  设计图   |   大方程式酒吧    工作簿和工作表管理器   |  资源库 (自动文本)   |  日期选择器   |  合并工作表   |  加密/解密单元格    按列表发送电子邮件   |  超级筛选   |   特殊过滤器 (过滤粗体/斜体/删除线...)...
前 15 个工具集12 文本 工具 (添加文本, 删除字符,...)   |   50+ 图表 类型 (甘特图,...)   |   40+ 实用 公式 (根据生日计算年龄,...)   |   19 插入 工具 (插入二维码, 从路径插入图片,...)   |   12 转化 工具 (小写金额转大写, 货币兑换,...)   |   7 合并与拆分 工具 (高级组合行, 分裂细胞,...)   |   ... 和更多

使用 Kutools for Excel 增强您的 Excel 技能,体验前所未有的效率。 Kutools for Excel 提供了 300 多种高级功能来提高生产力并节省时间。  单击此处获取您最需要的功能...

产品描述


Office Tab 为 Office 带来选项卡式界面,让您的工作更加轻松

  • 在Word,Excel,PowerPoint中启用选项卡式编辑和阅读,发布者,Access,Visio和Project。
  • 在同一窗口的新选项卡中而不是在新窗口中打开并创建多个文档。
  • 每天将您的工作效率提高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