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.

Insertar texto en filas vacias

publicado

Hola a todos, por favor si alguien me puede ayudar con el siguiente caso:
Tengo una hoja llamada "sin formato" la cual necesito dar formato en la hoja llamada "con formato".
lo que necesito es que a partir de cada fila vacia de la hoja "sin formato" se inserte una debajo de otra el siguiente texto :
SALDO ANTERIOR :
MOVIMIENTOS MES :
SALDO ACTUAL :
SALDO TOTAL :
debiendo quedar tal como se muestra en la hoja llamada "con formato" y si se pudiera hacer el respectivo calculo tal como se muestra en las columnas "F" y "G" que se encuentran sombreadas de color celeste.

Muchas gracias

Consulta_Libro.xlsm

Featured Replies

publicado

Hay un error e tu ejemplo? ya que al principio hat dos juntas y una la desapareces???

Aclara para poder continuar.

Gracias.

publicado
  • Autor

Gracias Leopoldo por responder,  Correcto si me equivoque no debí desaparecerlo

publicado

Disminuyendo una variable... y 3 renglones, :lol::lol::lol:

Sub InsertarFilas()
Dim nFila&, nFilaIni&, nFilaFin&
    Application.ScreenUpdating = False
    nFilaIni = 7:nFila = 7
    Do While Cells(nFila, 5) <> Empty
        If Cells(nFila, "E") Like "*TOTALES*" Then
            nFilaFin = nFila - 1
            Range(nFila & ":" & nFila + 3).EntireRow.Insert
            Cells(nFila, "E") = "SALDO ANTERIOR:"
            Cells(nFila + 1, "E") = "MOVIMIENTO DEL MES:": Cells(nFila + 1, "F").FormulaLocal = "=SUMA(F" & nFilaIni & ":F" & nFilaFin & ")": Cells(nFila + 1, "G").FormulaLocal = "=SUMA(G" & nFilaIni & ":G" & nFilaFin & ")"
            Cells(nFila + 2, "E") = "SALDO ACTUAL:": Cells(nFila + 2, "F").FormulaLocal = "=SUMA(F" & nFila & ":F" & nFila + 1 & ")": Cells(nFila + 2, "G").FormulaLocal = "=SUMA(G" & nFila & ":G" & nFila + 1 & ")"
            Cells(nFila + 3, "E") = "SALDO TOTAL:": Cells(nFila + 3, "F").FormulaLocal = "=SI(F" & nFila + 2 & ">" & "G" & nFila + 2 & ",F" & nFila + 2 & "-" & "G" & nFila + 2 & "," & """  """ & ")": Cells(nFila + 3, "G").FormulaLocal = "=SI(G" & nFila + 2 & ">" & "F" & nFila + 2 & ",G" & nFila + 2 & "-" & "F" & nFila + 2 & "," & """  """ & ")"
            Cells(nFila + 4, "E").EntireRow.Clear
            nFila = nFila + 4: nFilaIni = nFila + 1
        End If
        nFila = nFila + 1
    Loop
    Application.ScreenUpdating = True
End Sub


Saludos.

Editado el por Leopoldo Blancas

publicado
  • Autor

Gracias Leopoldo, lo acabo de probar y funciona muy bien, me salvaste,

quedo muy agardecido.

Saludos.

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.