Bienvenido a la mayor comunidad de usuarios EXCEL

Regístrate gratis ahora para ver contenidos y descargas sin restricciones!

Regístrate gratis

Macro Excel actualizar datos

Registrado
20 Oct 2021
Mensajes
67
Señores expertos
Tengo una macro que me ha funcionado bien, la cual me actualiza datos de una hoja a otra dentro del mismo libro, hoy día surge una necesidad de actualizar libro llamado MTTO...
Para poder visualizar el resto de este tema y sus adjuntos:
. Si nunca te has registrado puedes registrarte gratis aquí
. Si ya te has registrado debes
iniciar sesión aquí
 

Adjuntos

  • Captura de pantalla 2024-07-17 113601.webp
    Captura de pantalla 2024-07-17 113601.webp
    59,3 KB · Visitas: 8
Solución
Sólo agrega esa linea..!!!


Código:
Sub actualizar_LBV()
    Set l1 = ThisWorkbook
    Set h1 = l1.ActiveSheet
    Set l2 = Workbooks("Rutina Mtto Preventivo")
    Set h2 = l2.Worksheets("Rutina Mtto Preventivo (3)")
    Set r = h2.Columns("A")
    For i = 2 To h1.Range("B" & Rows.Count).End(xlUp).Row
        Set b = r.Find(h1.Cells(i, "B"), lookat:=xlWhole)
        If Not b Is Nothing Then
            Set b = r.FindPrevious(after:=b)
            cAddress = b.Address
            Do
                If h1.Cells(i, "R") <= h2.Cells(b.Row, "G") Then
                    h2.Cells(b.Row, "H") = h1.Cells(i, "R")
                    h2.Cells(b.Row, "I") = h1.Cells(i, "S")
                    h2.Cells(b.Row, "F") = h1.Cells(i...
Hola,

Código:
Sub Actualizar_LBV()
    Set l1 = ThisWorkbook
    Set h1 = l1.ActiveSheet
    Set l2 = Workbooks("Rutina Mtto Preventivo")
    Set h2 = l2.Worksheets("Rutina Mtto Preventivo (3)")...
Para poder visualizar el resto de este tema y sus adjuntos:
. Si nunca te has registrado puedes registrarte gratis aquí
. Si ya te has registrado debes
iniciar sesión aquí
 
Última edición:

Adjuntos

  • 1721943708802.webp
    1721943708802.webp
    12,3 KB · Visitas: 0
  • 1721944236789.webp
    1721944236789.webp
    10,9 KB · Visitas: 0
Sólo agrega esa linea..!!!


Código:
Sub actualizar_LBV()
    Set l1 = ThisWorkbook
    Set h1 = l1.ActiveSheet
    Set l2 = Workbooks("Rutina Mtto Preventivo")
    Set h2 = l2.Worksheets("Rutina...
Para poder visualizar el resto de este tema y sus adjuntos:
. Si nunca te has registrado puedes registrarte gratis aquí
. Si ya te has registrado debes
iniciar sesión aquí
 
Volver
Arriba