Agregar datos a un código

Agregar las palabras intereses y compra al archivo dam6 muchas gracias

1 Respuesta

Respuesta
1

Te anexo el código completo de la función para agregar los datos.

Sub PegaDatosDeInteresesEnCashflow(f, filabono)
'Por.Dante Amor
    Dim fec As Date
    Set h1 = Sheets("INTERESES")
    Set h2 = Sheets("CASHFLOW")
    Set h3 = Sheets("BONOS")
    u = 5
    Do While h2.Cells(u, "A") <> ""
        u = u + 1
    Loop
    h2.Rows(u + 1).Insert Shift:=xlDown, CopyOrigin:=xlFormatFromRightOrBelow
    h2.Cells(u, "A") = h1.Cells(f, "A")
    h2.Cells(u, "B") = h1.Cells(f, "C") & " - COMPRA"
    fec = DateSerial(Year(h1.Cells(f, "A")), Month(h1.Cells(f, "A")), 1)
    Set b = h2.Rows(2).Find(fec, LookIn:=xlFormulas)
    If Not b Is Nothing Then
        h2.Cells(u, b.Column) = h3.Cells(filabono, "R") * -1
    End If
    u = u + 1
    h2.Rows(u).Insert Shift:=xlDown, CopyOrigin:=xlFormatFromRightOrBelow
    For i = f To h1.Range("A" & Rows.Count).End(xlUp).Row
        fec = DateSerial(Year(h1.Cells(i, "B")), Month(h1.Cells(i, "B")), 1)
        Set b = h2.Rows(2).Find(fec, LookIn:=xlFormulas)
        If Not b Is Nothing Then
            h2.Cells(u, "A") = h1.Cells(i, "A")
            h2.Cells(u, "B") = h1.Cells(i, "C") & " - INTERESES"
            h2.Cells(u, b.Column) = h1.Cells(i, "D")
        End If
    Next
    h2.Select
    MsgBox "Datos archivado en el Cashflow", vbInformation
End Sub

Añade tu respuesta

Haz clic para o

Más respuestas relacionadas