提示:其它语言是由 Google 机器翻译的。 你可以访问 English 版本。
登录
x
or
x
x
马上登记
x

or

如何将值粘贴到可见/过滤的单元格只在Excel中?

在Excel中,如果您已过滤数据或隐藏了某些单元格,并且将值粘贴到已过滤或隐藏的范围中,则隐藏的单元格也将填充粘贴的值。 这里我会告诉你一些技巧,只在Excel中将值粘贴到可见单元格。

使用VBA将值粘贴到可见单元格

使用粘贴到Excel的可视范围的Kutools将值粘贴到可见单元格 好idea3

批量在Excel范围内的特定间隔中插入空白行或列

如果要在每隔一行中插入空行,可能需要逐个插入,但是 插入空白行和列 of Kutools for Excel 可以在几秒钟内完成这项工作。 点击60天免费试用!
doc插入空行列
Kutools for Excel:拥有超过300便利的Excel加载项,可以在60天免费试用,不受限制。

在Excel中,除VBA之外没有其他方法可以解决此问题。

1。 按 Alt + F11键 键,同时,和 Microsoft Visual Basic for Applications 窗口弹出。

2。 点击 插页 > 模块,然后将VBA代码粘贴到弹出的模块窗口中。

VBA:仅将值粘贴到可见单元格。

Sub CopyFilteredCells()
	'Updateby20150203
	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

3。 点击 F5 钥匙还是 按钮,弹出一个对话框供您选择要复制的值。 看截图:
文档粘贴到可见细胞1

4。 选择值后,单击 OK,弹出另一个对话框来选择一个范围来粘贴选定的数据。 看截图:
文档粘贴到可见细胞2

5。 点击 OK。 您只能看到可见单元格粘贴了所选值。


其实,如果你使用 粘贴到可见范围 实用程序 Kutools for Excel - 一个方便的Excel工具,可以快速轻松地解决将值粘贴到可见范围的问题。
doc粘贴可见单元格6

Kutools for Excel, 与超过 300 方便的功能,让您的工作更轻松。

安装后 Kutools for Excel,请按照以下步骤操作:(免费下载Kutools for Excel!)

1。 选择要复制和粘贴的值的范围,然后单击 Kutools > Range > 粘贴到可见范围 > 全部/只粘贴值。 看截图:
doc粘贴可见单元格7

2。 然后a 粘贴到可见范围 弹出对话框,然后选择要粘贴值的范围。 看截图:
doc粘贴可见单元格8

3。 点击 OK。 现在,选定的值仅粘贴到可见范围内。

仅将值粘贴到可见单元格 全部粘贴到可见单元格
doc粘贴可见单元格9 doc粘贴可见单元格10

请注意: 该实用程序既适用于隐藏的和过滤的行或列

点击此处查看有关粘贴到可见范围工具的更多详细信息。

提示。 如果你想免费试用的话 粘贴到可见范围 功能,请去 免费下载 首先是Kutools for Excel,然后按照上述步骤进行操作。


选项卡式浏览和编辑多个Excel工作簿/ Word文档,如Firefox,Chrome,Internet浏览10!

您可能熟悉在Firefox / Chrome / IE中查看多个网页,并通过轻松单击相应的选项卡在它们之间切换。 此处,Office选项卡支持类似的处理,允许您在一个Excel窗口或Word窗口中浏览多个Excel工作簿或Word文档,并通过单击其选项卡轻松切换它们。 点击Office Tab的免费45天试用版!

擅长

Kutools for Excel - 最佳办公生产力工具提高80%的生产力

  • 重用: 快速插入 复杂的公式,图表 以及你以前用过的任何东西; 加密单元格 密码; 创建邮件列表 并发送电子邮件...
  • 超级方程式酒吧 (轻松编辑多行文字和公式); 阅读布局 (轻松读取和编辑大量单元格); 粘贴到过滤范围...
  • 合并单元格/行/列 不丢失数据; 分裂细胞含量; 组合重复的行/列...防止重复的细胞; 比较范围...
  • 选择复制或唯一 行; 选择空行 (所有细胞都是空的); 超级查找和模糊查找 在许多工作簿中; 随机选择......
  • 精确复制 多个单元格而不更改公式参考; 自动创建参考 多张表; 插入项目符号,复选框等等......
  • 提取文本,添加文本,按位置删除, 删除空间; 创建和打印分页小计; 在单元格内容和注释之间转换...
  • 超级过滤器 (将过滤方案保存并应用到其他工作表); 高级排序 按月/周/日,频率等; 特殊过滤器 用粗体,斜体......
  • 结合工作簿和工作表; 根据键列合并表; 将数据拆分为多个表格; 批量转换xls,xlsx和PDF...
  • 超过300强大的功能。 支持Office / Excel 2007-2019和365。 支持所有语言。 在您的企业或组织中轻松部署。 全功能60天免费试用。
kte tab 201905

Office选项卡为Office提供选项卡式界面,使您的工作更轻松

  • 在Word,Excel,PowerPoint中启用选项卡式编辑和阅读,Publisher,Access,Visio和Project。
  • 在同一窗口的新选项卡中打开并创建多个文档,而不是在新窗口中。
  • 通过50%提高您的工作效率,每天为您减少数百次鼠标点击!
官方底部
Say something here...
symbols left.
You are guest ( Sign Up? )
or post as a guest, but your post won't be published automatically.
Loading comment... The comment will be refreshed after 00:00.
  • To post as a guest, your comment is unpublished.
    Laurel · 1 months ago
    After going absolutely crazy trying to find a solution, this worked - specifically, the macro for pasting INTO visible only cells. Note that I was copying only from unfiltered cells. However, the people complaining that it doesn't do both (which I'm not sure is true) should be quiet because it's pretty easy to copy FROM only visible/filtered cells into an unfiltered area. You don't need a macro for that (and if you're trying to do both, just do the copying of filtered cells in Excel first, then use this macro). Again, what Excel is fully unable to do on its own without a macro is to paste to visible cells only. This macro saved my bum. Thanks!
  • To post as a guest, your comment is unpublished.
    Rachel · 1 years ago
    This worked perfectly, thanks!
  • To post as a guest, your comment is unpublished.
    Christine · 1 years ago
    You can also easily do this without a plugin....
    CTRL+C the cells you want to paste
    Highlight the filtered/partially hidden range you're pasting to
    CTRL+G
    Select "Special"
    Select "Visible Cells Only" & hit OK
    CTRL+V
    • To post as a guest, your comment is unpublished.
      Sunny · 1 years ago
      Thansk for you reply, but it does not work. With your method, it paste all cells including hidden ones with the copied values.
  • To post as a guest, your comment is unpublished.
    Mark · 1 years ago
    VBA method did not work! It copied the invisible cells into the visible cells. Now, I realize that the title doesn't say "How to paste values FROM VISIBLE/FILTERED CELLS to visible/filtered cells only in Excel?" but if my workbook is filtered, it's highly possible that this is what is needed. If this is what you want - copy from one section to another (or to simply paste values from certain cells right back to the same cells, so to remove the fomulas) you first need to copy/paste values to an unfiltered workbook/worksheet. THEN you can use the macro...or at least I hope you can. I didn't save my data and UNDO does not work....
    • To post as a guest, your comment is unpublished.
      Sunny · 1 years ago
      I am sorry for that.
      • To post as a guest, your comment is unpublished.
        C&P · 1 years ago
        So is there any update version for this situation?
  • To post as a guest, your comment is unpublished.
    Radosław Hagno · 2 years ago
    It is even more flexible and functional if the inner loop is constructed with Do While loop.
  • To post as a guest, your comment is unpublished.
    Tomi · 2 years ago
    This was very helpful. Many thanks.
  • To post as a guest, your comment is unpublished.
    Shamna · 2 years ago
    i am currently developing a macro. In that i need to do filter for a particular column for Eg: Column D and need to paste some values Eg: Valid in column B.
    only i need to paste the value for the filtered cells.
    And also i want to know the coding for multiple filters at a time. EG: filtering in one column and checking the value and again do filter in another column without making false for the previous filter.
    help me on this.
  • To post as a guest, your comment is unpublished.
    Leo · 2 years ago
    This works great up to record 1163 of 23,000 and then it stops. Why would it stop?
  • To post as a guest, your comment is unpublished.
    Mikhail · 2 years ago
    You rock! I've had this issue multiple times in the past but it became a back-breaker for the recent project. And you've helped me to fix it beautifully. THANK YOU!
  • To post as a guest, your comment is unpublished.
    Bill · 3 years ago
    This works for me, but is there any way to select a "Paste Range" in another worksheet that is open? Thanks.
  • To post as a guest, your comment is unpublished.
    ZUHDI · 3 years ago
    GOD!! you help me so much
  • To post as a guest, your comment is unpublished.
    christine harrison · 3 years ago
    Badass, that's all I have to say. Thank you so much.
  • To post as a guest, your comment is unpublished.
    edwin · 3 years ago
    Thanks for this information, helps me a lot
  • To post as a guest, your comment is unpublished.
    Aida Isabel · 4 years ago
    Paste to visible range function does not work!
  • To post as a guest, your comment is unpublished.
    G · 4 years ago
    I am curious if an Excel update has caused instability. I previously was able to use the VBA code successfully, but now it is causing the copied area to be pasted nonstop beyond the selected range. Results in Excel hanging.
  • To post as a guest, your comment is unpublished.
    Menzi · 4 years ago
    Tried this plugin for the paste into filtered selection. Does not work for me. Crashes every time . Using excel 2013.
  • To post as a guest, your comment is unpublished.
    valentin · 4 years ago
    love u man!!!!!!!!!!