Saltar al contenido principal

¿Cómo pegar valores en celdas visibles / filtradas solo en Excel?

En Excel, si ha filtrado datos u ocultado algunas celdas, y cuando pega valores en el rango filtrado u oculto, las celdas ocultas también se llenarán con valores pegados. Aquí te contaré algunos trucos para pegar valores en celdas visibles solo en Excel.

Pegar valores en celdas visibles con VBA

Pegar valores en celdas visibles con Pegar en rango visible de Kutools para Excel buena idea3


Pegar valores en celdas visibles con VBA

En Excel, no hay otras formas de resolver este problema excepto VBA.

1. Prensa Alt + F11 teclas simultáneamente, y un Microsoft Visual Basic para aplicaciones estallidos de ventana.

2. Hacer clic en recuadro > Módulo, luego pegue debajo del código VBA en la ventana emergente del Módulo.

VBA: pegue los valores solo en las celdas visibles.

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. Hacer clic en F5 clave o la Ejecutar , aparecerá un cuadro de diálogo para que seleccione los valores que desee copiar. Ver captura de pantalla:
doc-pegar-en-celda-visible-1

4. Después de seleccionar los valores, haga clic en OK, luego aparece otro cuadro de diálogo para seleccionar un rango para pegar los datos seleccionados. Ver captura de pantalla:
doc-pegar-en-celda-visible-2

5. Hacer clic en OK. Puede ver que solo las celdas visibles se pegan con los valores seleccionados.


Pegar valores en celdas visibles con Pegar en rango visible de Kutools para Excel

En realidad, si usa Pegar en rango visible utilidad de Kutools for Excel - una práctica herramienta de Excel, puede resolver rápida y fácilmente el problema de pegar valores en el rango visible.
doc pegar celda visible 6

Kutools for Excel, con más de 300 funciones prácticas, facilita su trabajo. 

Después de instalar Kutools para Excel, haga lo siguiente:(¡Descarga gratis Kutools para Excel ahora!)

1. Seleccione un rango de valores que desee copiar y pegar, luego haga clic en Kutools > Gama de Colores > Pegar en rango visible > Todos or Solo pegar valores. Ver captura de pantalla:
doc pegar celda visible 7

2. Entonces un Pegar en rango visible aparece el cuadro de diálogo y seleccione el rango en el que desea pegar los valores. Ver captura de pantalla:
doc pegar celda visible 8

3. Hacer clic en OK. Ahora los valores seleccionados se pegan solo en el rango visible.

Pegar solo valores en celdas visibles Pegar todo en las celdas visibles
doc pegar celda visible 9 doc pegar celda visible 10


Nota:
Esta utilidad funciona tanto en filas o columnas ocultas como filtradas

Haga clic aquí para obtener más información detallada sobre la utilidad Pegar en rango visible.

  Pegar solo en celdas visibles

Las mejores herramientas de productividad de oficina

🤖 Asistente de IA de Kutools: Revolucionar el análisis de datos basado en: Ejecución inteligente   |  Generar codigo  |  Crear fórmulas personalizadas  |  Analizar datos y generar gráficos  |  Invocar funciones de Kutools...
Características populares: Buscar, resaltar o identificar duplicados   |  Eliminar filas en blanco   |  Combine columnas o celdas sin perder datos   |   Ronda sin fórmula ...
Super búsqueda: Búsqueda virtual de criterios múltiples    Búsqueda V de valores múltiples  |   VLookup en varias hojas   |   Búsqueda difusa ....
Lista desplegable avanzada: Crear rápidamente una lista desplegable   |  Lista desplegable dependiente   |  Lista desplegable de selección múltiple ....
Administrador de columnas: Agregar un número específico de columnas  |  Mover columnas  |  Toggle Estado de visibilidad de columnas ocultas  |  Comparar rangos y columnas ...
Características destacadas: Enfoque de cuadrícula   |  Vista de diseño   |   Gran barra de fórmulas    Administrador de hojas y libros de trabajo   |  Biblioteca de Recursos (Texto automático)   |  Selector de fechas   |  Combinar hojas de trabajo   |  Cifrar/descifrar celdas    Enviar correos electrónicos por lista   |  Súper filtro   |   Filtro especial (filtro negrita/cursiva/tachado...) ...
Los 15 mejores conjuntos de herramientas12 Texto Herramientas (Añadir texto, Quitar caracteres, ...)   |   50+ Tabla Tipos (Diagrama de Gantt, ...)   |   40+ Práctico Fórmulas (Calcular la edad según el cumpleaños, ...)   |   19 Inserción Herramientas (Insertar código QR, Insertar imagen desde la ruta, ...)   |   12 Conversión Herramientas (Números a palabras, Conversión de Moneda, ...)   |   7 Fusionar y dividir Herramientas (Filas combinadas avanzadas, Células partidas, ...)   |   ... y más

Mejore sus habilidades de Excel con Kutools for Excel y experimente la eficiencia como nunca antes. Kutools for Excel ofrece más de 300 funciones avanzadas para aumentar la productividad y ahorrar tiempo.  Haga clic aquí para obtener la función que más necesita...

Descripción


Office Tab lleva la interfaz con pestañas a Office y hace que su trabajo sea mucho más fácil

  • Habilite la edición y lectura con pestañas en Word, Excel, PowerPoint, Publisher, Access, Visio y Project.
  • Abra y cree varios documentos en nuevas pestañas de la misma ventana, en lugar de en nuevas ventanas.
  • ¡Aumenta su productividad en un 50% y reduce cientos de clics del mouse todos los días!
Comments (22)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Thank you very much hundred times
This comment was minimized by the moderator on the site
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!
This comment was minimized by the moderator on the site
Thanks for your recognition.
This comment was minimized by the moderator on the site
This worked perfectly, thanks!
This comment was minimized by the moderator on the site
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
This comment was minimized by the moderator on the site
Thansk for you reply, but it does not work. With your method, it paste all cells including hidden ones with the copied values.
This comment was minimized by the moderator on the site
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....
This comment was minimized by the moderator on the site
I am sorry for that.
This comment was minimized by the moderator on the site
So is there any update version for this situation?
This comment was minimized by the moderator on the site
It is even more flexible and functional if the inner loop is constructed with Do While loop.
This comment was minimized by the moderator on the site
This was very helpful. Many thanks.
This comment was minimized by the moderator on the site
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.
This comment was minimized by the moderator on the site
This works great up to record 1163 of 23,000 and then it stops. Why would it stop?
This comment was minimized by the moderator on the site
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!
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