Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

245
Vistas
Código VBA para combinar dos libros de trabajo en una hoja de trabajo

Quiero saber si es posible traer dos libros de trabajo (hoja 1) en una hoja de trabajo (libro de trabajo maestro). Necesito tener dos datos juntos en una hoja de cálculo.

Cualquier ayuda es muy apreciada. A continuación se muestran capturas de pantalla para obtener más detalles si ayuda.

Dos archivos:

  1. Páginas de recaudación de fondos(1).csv
  2. Partidarios(1).csv

Consulte el archivo adjunto para obtener más detalles si es de ayuda.

ingrese la descripción de la imagen aquí


Gracias por examinar esto.

Datos del archivo 1 y del archivo 2: ambos tienen las mismas direcciones de correo electrónico.

Es importante destacar que me gustaría una macro para extraer datos para identificar o incluso hacer coincidir ambas direcciones de correo electrónico. Si lo encuentra, agréguelo a una hoja de trabajo.

Por ejemplo, en la hoja de trabajo (maestra) debe haber un archivo de datos 1 en el lado izquierdo y el archivo de datos 2 en el lado derecho, incluidos los encabezados.

Espero que puedas ver mis imágenes con claridad.

Saludos

V

ingrese la descripción de la imagen aquí

ingrese la descripción de la imagen aquí

about 4 years ago · Santiago Trujillo
2 Respuestas
Responde la pregunta

0

Aquí hay una descripción general para comenzar:

https://support.microsoft.com/en-us/office/import-or-export-text-txt-or-csv-files-5250ac4c-663c-47ce-937b-339e391393ba

Vba Importar archivos CSV a Excel

Propuesta: el uso de la conexión a través de PowerQuery le permite procesarlos más como tablas y también unirlos/fusionarlos en uno mientras puede ver y seguir cada paso del proceso.

about 4 years ago · Santiago Trujillo Denunciar

0

Algo como esto debería hacer lo que quieras. Siéntase libre de cambiar el código para satisfacer sus necesidades.

 Sub CopyRangeFromMultiWorksheets() Dim sh As Worksheet Dim DestSh As Worksheet Dim Last As Long Dim CopyRng As Range With Application .ScreenUpdating = False .EnableEvents = False End With 'Delete the sheet "RDBMergeSheet" if it exist Application.DisplayAlerts = False On Error Resume Next ActiveWorkbook.Worksheets("RDBMergeSheet").Delete On Error GoTo 0 Application.DisplayAlerts = True 'Add a worksheet with the name "RDBMergeSheet" Set DestSh = ActiveWorkbook.Worksheets.Add DestSh.Name = "RDBMergeSheet" 'loop through all worksheets and copy the data to the DestSh For Each sh In ActiveWorkbook.Worksheets If sh.Name <> DestSh.Name Then 'Find the last row with data on the DestSh Last = LastRow(DestSh) 'Fill in the range that you want to copy Set CopyRng = sh.Range("A1:G1") 'Test if there enough rows in the DestSh to copy all the data If Last + CopyRng.Rows.Count > DestSh.Rows.Count Then MsgBox "There are not enough rows in the Destsh" GoTo ExitTheSub End If 'This example copies values/formats, if you only want to copy the 'values or want to copy everything look at the example below this macro CopyRng.Copy With DestSh.Cells(Last + 1, "A") .PasteSpecial xlPasteValues .PasteSpecial xlPasteFormats Application.CutCopyMode = False End With 'Optional: This will copy the sheet name in the H column DestSh.Cells(Last + 1, "H").Resize(CopyRng.Rows.Count).Value = sh.Name End If Next ExitTheSub: Application.Goto DestSh.Cells(1) 'AutoFit the column width in the DestSh sheet DestSh.Columns.AutoFit With Application .ScreenUpdating = True .EnableEvents = True End With End Sub

Función LastRow(sh como hoja de trabajo) En caso de error Reanudar Next LastRow = sh.Cells.Find(What:="*", _ After:=sh.Range("A1"), _ Lookat:=xlPart, _ LookIn:=xlFormulas , _ SearchOrder:=xlByRows, _ SearchDirection:=xlPrevious, _ MatchCase:=False).Row On Error GoTo 0 End Function

Función LastCol(sh como hoja de trabajo) En caso de error Reanudar Next LastCol = sh.Cells.Find(What:="*", _ After:=sh.Range("A1"), _ Lookat:=xlPart, _ LookIn:=xlFormulas , _ SearchOrder:=xlByColumns, _ SearchDirection:=xlPrevious, _ MatchCase:=False).Column On Error GoTo 0 End Function

Código fuente:

https://www.rondebruin.nl/win/s3/win002.htm

Además, echa un vistazo a esto.

https://www.rondebruin.nl/win/addins/rdbmerge.htm

about 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda