Saltar al contenido
View in the app

A better way to browse. Learn more.

Ayuda Excel

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Macro transformar archivo espacio en blanco a base de datos

publicado

hola Amigos!! espero se encuentren muy bien, 

En el archivo adjunto, encontrarán dos hojas: MB5L y BD. Debo transformar la información que se encuentra en MB5L y estructura como una base de datos en la hoja BD. 
para realizar esto en la mB5L debe se coger los datos que se encuentran en las columnas "i" a "n" copiarlos y pegarlos en las columnas "c" a "h" en la hoja BD. Adicional, se debe repetir la sociedad y la cta mayor por cada registro que se pega en la hoja BD. la soc se encuentra para el primer caso en la celda C5 y cta mayor en B6.

Comparto una hoja de como debería de quedar el resultado ?

si me pueden ayudar, se lo agradecería mucho!!

MB25 - ejercicio.xlsb

Featured Replies

publicado
 With Hoja1
        .Range("I7", "N" & .Range("I" & Rows.Count).End(xlUp).Row).Copy Destination:=Hoja2.Range("C2")
        .Range("B6", "B" & .Range("B" & Rows.Count).End(xlUp).Row).Copy Destination:=Hoja2.Range("A2")
        .Range("C5", "C" & .Range("C" & Rows.Count).End(xlUp).Row).Copy Destination:=Hoja2.Range("B2")
        
    End With
    With Hoja2
        dato = .Cells(2, 2)
        dato1 = .Cells(2, 1)
        For x = 2 To .Range("C" & Rows.Count).End(xlUp).Row - 1
            If .Cells(x + 1, 2) = "" Or IsNumeric(.Cells(x + 1, 2)) Then
               .Cells(x + 1, 2) = dato
               
            Else
                dato = .Cells(x + 1, 2)
            End If
            
            If .Cells(x + 1, 1) = "" Then
                .Cells(x + 1, 1) = dato1
            Else
                 dato1 = .Cells(x + 1, 1)
            End If
        Next x
        .Columns("C:C").SpecialCells(xlCellTypeBlanks).EntireRow.Delete
  
    End With

Prueba y comenta

image.gif

MB25 - ejercicio.xlsm

publicado
  • Autor
hace 1 hora, JSDJSD dijo:
 With Hoja1
        .Range("I7", "N" & .Range("I" & Rows.Count).End(xlUp).Row).Copy Destination:=Hoja2.Range("C2")
        .Range("B6", "B" & .Range("B" & Rows.Count).End(xlUp).Row).Copy Destination:=Hoja2.Range("A2")
        .Range("C5", "C" & .Range("C" & Rows.Count).End(xlUp).Row).Copy Destination:=Hoja2.Range("B2")
        
    End With
    With Hoja2
        dato = .Cells(2, 2)
        dato1 = .Cells(2, 1)
        For x = 2 To .Range("C" & Rows.Count).End(xlUp).Row - 1
            If .Cells(x + 1, 2) = "" Or IsNumeric(.Cells(x + 1, 2)) Then
               .Cells(x + 1, 2) = dato
               
            Else
                dato = .Cells(x + 1, 2)
            End If
            
            If .Cells(x + 1, 1) = "" Then
                .Cells(x + 1, 1) = dato1
            Else
                 dato1 = .Cells(x + 1, 1)
            End If
        Next x
        .Columns("C:C").SpecialCells(xlCellTypeBlanks).EntireRow.Delete
  
    End With

Prueba y comenta

image.gif

MB25 - ejercicio.xlsm 209.88 kB · 2 descargas

muchas gracias @JSDJSD!! excelente la solución :) 

Archivado

Este tema está ahora archivado y está cerrado a más respuestas.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.