跳到主要内容

如何将数据粘贴到筛选列表中,仅跳过Excel中的隐藏行?

众所周知,当我们尝试将值粘贴到过滤的表列表中时,隐藏的行不会被跳过,因此我们将得到错误的结果。 例如,我有两个工作表,工作表1包含已过滤掉的数据,工作表2包含我要粘贴到过滤后的工作表1的数据,如下面的屏幕快照所示。 有什么功能可以让我们仅在Excel中将数据粘贴到过滤的行中?

文档粘贴到过滤数据 1 文档粘贴到过滤数据 2

使用助手列将数据粘贴到Excel中的过滤列表中

使用 Kutools for Excel 将数据粘贴到 Excel 中的过滤列表中


箭头蓝色右气泡 使用助手列将数据粘贴到Excel中的过滤列表中

要将数据粘贴到过滤列表中,您需要应用一些帮助器列,请按以下步骤操作:

1。 首先,点击 时间 > 筛选器 要删除过滤器,请分别在过滤器列旁边的单元格C1和C2中分别输入2、3,然后选择单元格C2和C3,然后将填充手柄拖到工作表1中与数据相对应的单元格中。请参见屏幕截图:

文档粘贴到过滤数据 3

2. 然后通过单击再次过滤数据 时间 > 筛选器,在此示例中,我将过滤工作表1中的“ KTE”,然后键入此公式 = ROW() 到单元格D2中,然后将此公式填充到D列所需的可见单元格中,请参见屏幕截图:

文档粘贴到过滤数据 4 2 文档粘贴到过滤数据 5

3。 然后再次取消过滤器,并按D列以升序对数据进行排序,所有KTE项均已排序在一起,请参见屏幕截图:

文档粘贴到过滤数据 4

4。 接下来,您可以在工作表1中复制数据A6:B2,并将它们粘贴到工作表2的范围A7:B1中。

文档粘贴到过滤数据 4

5。 然后,您需要恢复原始数据顺序,请单击C列并对数据进行升序排序,请参见屏幕截图:

文档粘贴到过滤数据 4

6。 并且数据顺序已恢复,然后可以根据需要删除C列和D列的内容,最后可以过滤所需的数据,并且可以看到过滤的数据已成功替换为新数据。

文档粘贴到过滤数据 4


箭头蓝色右气泡 使用 Kutools for Excel 将数据粘贴到 Excel 中的过滤列表中

第一种方法应用起来太复杂,因此,在这里,我将向您介绍一个方便的工具- Kutools for Excel,其 粘贴到可见范围 功能,您可以快速将数据粘贴到过滤列表中,而无需付出太多努力。

Kutools for Excel : 带有300多个便捷的Excel加载项,可以在30天内免费试用.

安装后 Kutools for Excel,请执行以下操作:

1。 首先,选择要复制并粘贴到过滤列表的数据排列。 然后点击 库工具 > 范围 > 粘贴到可见范围,请参见屏幕截图:

文档粘贴到过滤数据 4

2。 然后一个 粘贴到可见范围 弹出提示框,单击要粘贴新数据的单元格或范围单元格,请参见屏幕截图:

文档粘贴到过滤数据 4

3。 然后点击 OK 按钮,新数据仅粘贴到过滤列表中,隐藏行数据也将保留。

(1.)如果选择 仅粘贴值 选项,仅将值粘贴到过滤的数据中,请参见screesnhot:

文档粘贴到过滤数据 4

(2.)如果选择 所有类型 选项,值和格式将粘贴到过滤的数据中,请参见screesnhot:

文档粘贴到过滤数据 4

单击以了解有关此粘贴到可见范围实用程序的更多信息。


箭头蓝色右气泡 仅使用 Kutools for Excel 将单元格值复制并粘贴到可见或过滤的单元格中:

Kutools for Excel:具有300多个方便的Excel加载项,可以在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 (11)
Rated 5 out of 5 · 2 ratings
This comment was minimized by the moderator on the site
It works, thank you. The first method is quiet simple for me even for the table with thousands of rows.
Rated 5 out of 5
This comment was minimized by the moderator on the site
Qué gran solución. Lo máximo!
This comment was minimized by the moderator on the site
Hallo zusammen, ich habe die Version mit den Hilfsspalten soeben ausprobiert und mit ein paar kleinen Änderungen, funktioniert es auch in M365: = REIHE () gibt es nicht mehr, das heißt jetzt: =ZEILE()
Nachdem ich diese Formel eingefügt habe, habe ich (in meiner gefilterten Liste) die Werte, die bei =ZEILE() angezeigt werden farbig markiert. Erst anschließend habe ich wieder den Filter entfernt und die Liste nach der ausgewählten Farbe sortiert. Fertig! So kann man die obersten (farbigen) Zellen nun bearbeiten und Daten einfügen.
This comment was minimized by the moderator on the site
Muchas gracias, me sirvió mucho. Toda una tarde estaba viendo manera, pero con Kutools for Excel la vida es mas facil
Rated 5 out of 5
This comment was minimized by the moderator on the site
Hello, Saul,
Glad the Kutools can help you, 😀
This comment was minimized by the moderator on the site
Not working. I tried in Office 2007. I copied range of cell and try to paste into visible cells, the clipboard data deleted but its not pasting. Try to provide solution
This comment was minimized by the moderator on the site
A mon niveau c'est pareil, ça ne fonctionne pas. Existe-t-il autre solution ?
This comment was minimized by the moderator on the site
Hello, friends
If the above method can not work well, here, you can also use the below VBA code: (Note: Before using the code, you should backup your data, the code doesn't support undo.)
Sub CopyFilteredCells()
	'Updateby Extendoffice
	Dim rng1 As Range
	Dim rng2 As Range
	Dim InputRng As Range
	Dim OutRng As Range
	xTitleId     = "KutoolsforExcel"
	Set InputRng = Application.Selection
	Set InputRng = Application.InputBox("Copy Range :", xTitleId, InputRng.Address, Type: = 8)
	Set OutRng   = Application.InputBox("Paste Range:", xTitleId, Type: = 8)
	For Each rng1 In InputRng
		rng1.Copy
		For Each rng2 In OutRng
			If rng2.EntireRow.RowHeight > 0 Then
				rng2.PasteSpecial
				Set OutRng = rng2.Offset(1).Resize(OutRng.Rows.Count)
				Exit For
			End If
		Next
	Next
	Application.CutCopyMode = False
End Sub


Please have a try, hope it can help you!
This comment was minimized by the moderator on the site
I spent hours trying to solve this until I eventually found this awesome website. Thanks!
This comment was minimized by the moderator on the site
Very helpful and straightforward. I was looking everywhere on the internet and did not find anything. Or tutorials to achieve something else :) Thanks a lot
This comment was minimized by the moderator on the site
YOU. ARE. BAE. AND. THE. GOAT. But seriously thanks so much! I have been looking everywhere for help on this!
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations