Plan De Cuentas Contables Venezuela Excel Vba May 2026

Sub RegistrarAsiento()
    Dim codigoDebito As String, codigoCredito As String
    Dim monto As Double
codigoDebito = Range("E2").Value
codigoCredito = Range("F2").Value
monto = Range("G2").Value
If ValidarCuenta(codigoDebito) And ValidarCuenta(codigoCredito) Then
    Sheets("Transacciones").Cells(Sheets("Transacciones").Rows.Count, 1).End(xlUp).Offset(1, 0).Value = _
        Array(Date, "C-001", codigoDebito, monto, 0, "Asiento VBA")
    Sheets("Transacciones").Cells(Sheets("Transacciones").Rows.Count, 1).End(xlUp).Offset(1, 0).Value = _
        Array(Date, "C-001", codigoCredito, 0, monto, "Asiento VBA")
    MsgBox "Asiento registrado correctamente"
Else
    MsgBox "Error: Cuenta no válida"
End If

End Sub


Sub GenerarListaJerarquica()
    Dim wsPlan As Worksheet
    Dim wsOutput As Worksheet
    Dim lastRow As Long
    Dim i As Long
    Dim nivel As Integer
    Dim indent As String
Set wsPlan = ThisWorkbook.Sheets("Plan_Cuentas")
Set wsOutput = ThisWorkbook.Sheets.Add
wsOutput.Name = "VistaJerarquica"
lastRow = wsPlan.Cells(wsPlan.Rows.Count, 1).End(xlUp).Row
For i = 2 To lastRow
    nivel = wsPlan.Cells(i, 3).Value ' columna Nivel
    indent = String(nivel - 1, "-")
wsOutput.Cells(i - 1, 1).Value = indent & wsPlan.Cells(i, 1).Value
    wsOutput.Cells(i - 1, 2).Value = wsPlan.Cells(i, 2).Value
Next i

End Sub

Muchos requerimientos fiscales en Venezuela piden listados de cuentas. Esta macro genera un CSV limpio. plan de cuentas contables venezuela excel vba

Sub ExportarPlanDeCuentasACSV()
    Dim ws As Worksheet
    Dim rutaArchivo As String
    Dim archivoNum As Integer
    Dim ultimaFila As Long
    Dim i As Long
    Dim linea As String
Set ws = ThisWorkbook.Sheets("Maestro_Cuentas")
ultimaFila = ws.Cells(ws.Rows.Count, 1).End(xlUp).Row
rutaArchivo = ThisWorkbook.Path & "\Plan_Cuentas_Venezuela_" & Format(Date, "yyyymmdd") & ".csv"
archivoNum = FreeFile
Open rutaArchivo For Output As #archivoNum
' Escribir cabecera
linea = "Codigo,Nombre,Nivel,CodPadre,Naturaleza,TipoInflacion,Activa"
Print #archivoNum, linea
' Escribir datos
For i = 2 To ultimaFila
    linea = ws.Cells(i, 1).Value & "," & _
            ws.Cells(i, 2).Value & "," & _
            ws.Cells(i, 3).Value & "," & _
            ws.Cells(i, 4).Value & "," & _
            ws.Cells(i, 5).Value & "," & _
            ws.Cells(i, 6).Value & "," & _
            ws.Cells(i, 7).Value
    Print #archivoNum, linea
Next i
Close #archivoNum
MsgBox "✅ Exportación exitosa en:" & vbCrLf & rutaArchivo, vbInformation

End Sub

Elena stared at the spreadsheet on her screen. It was 11:47 PM. The Plan de Cuentas Contables de Venezuela—the official chart of accounts mandated by the SUNDDE and the FISCAL-i system—spread across 47 sheets like a drunk centipede.

Every month, she had to:

Her assistant, José, quit last week. His farewell message: "Elena, I’d rather sell tequeños from a cart than touch another VLOOKUP."

She laughed bitterly. Then she opened the Visual Basic for Applications (VBA) editor. End Sub

Disclaimers
1.
CIRS aims to keep the content of this site accurate and up to date. However, CIRS makes no warranties or representations regarding the quality, accuracy, completeness or reliability of information on the site.
2.
In no event shall CIRS assume or have any responsibility or liability for any information on this site or for any claims, damages or losses resulting from their use.
3.
CIRS reserves the right, at our discretion, to change, modify, add to, or remove portions of information on this site at any time without notice.