Documentos de Académico
Documentos de Profesional
Documentos de Cultura
Option Explicit
Private Sub btn_Agregar_Click()
Dim Fila As Long
Dim Final As Long
Application.ScreenUpdating = False
If ControlesVacios("plan_contable", Me) = True Then Exit Sub
Final = nReg(Hoja2, 2, 1)
With Hoja2
For Fila = 2 To Final
If .Cells(Fila, 1) = Val(Me.cbo_CodCuenta) Then
MsgBox ("Código de Cuenta ya existe!" + Chr(13) + "Ingrese uno diferente"), vbInformation
Me.cbo_CodCuenta.SetFocus
Me.cbo_CodCuenta.BackColor = RGB(211, 255, 211)
Exit Sub
End If
Next
.Unprotect "hola22"
If Len(Me.cbo_CodCuenta) = 1 Or Len(Me.cbo_CodCuenta) = 2 Then
.Range(.Cells(Final, 1), .Cells(Final, 3)).Font.Bold = True
ElseIf Len(Me.cbo_CodCuenta) = 3 Then
.Range(.Cells(Final, 1), .Cells(Final, 3)).Interior.Color = RGB(190, 190, 190)
.Range(.Cells(Final, 1), .Cells(Final, 3)).Font.Color = RGB(255, 255, 255)
.Range(.Cells(Final, 1), .Cells(Final, 3)).Font.Bold = True
End If
.Cells(Final, 1) = Me.cbo_CodCuenta.Value
.Cells(Final, 2) = Me.txt_NombreCuenta.Text
.Cells(Final, 3) = nGrupo
Call IndexarCodCuentasPLAN
.Protect "hola22"
End With
Me.cbo_CodCuenta = Me.cbo_CodCuenta + 1
Me.txt_NombreCuenta = Empty
Me.txt_NombreCuenta.SetFocus
Application.ScreenUpdating = True
End Sub
If MsgBox("¿Seguro que quiere eliminar esta Cuenta?", vbQuestion + vbYesNo) = vbYes Then
For Fila = 2 To Final
If .Cells(Fila, 1) = Val(Me.cbo_CodCuenta) Then
.Unprotect "hola22"
.Cells(Fila, 1).EntireRow.Delete
.Protect "hola22"
Exit For
End If
Next
MsgBox "La cuenta: " & Me.cbo_CodCuenta & " ha sido eliminada!", vbInformation
Call LimpiarControles("plan_contable", Me)
Me.cbo_CodCuenta.SetFocus
Else
Exit Sub
End If
End With
Application.ScreenUpdating = True
End Sub
End Sub
If MsgBox("¿Seguro que quiere modificar esta operación?", vbQuestion + vbYesNo) = vbYes Then
.Locked = True
Call OcultarBotonesRestantes
Me.cbo_CodCuenta.Value = .List(.ListIndex, 0)
Me.txt_Concepto.Text = .List(.ListIndex, 4)
End Sub
Private Sub btn_Eliminar_Click()
With Me.lbx_DebeHaber
If .ListIndex = -1 Then
MsgBox "Seleccione un registro para eliminar", vbInformation Exit Sub
End If
If MsgBox("¿Seguro que quiere eliminar esta operación?", vbQuestion + vbYesNo) = vbYes Then
If Me.opt_Cargar.Value = True Then
.RemoveItem (.ListIndex)
.ListIndex = -1
Call sumarDebe
Else
.RemoveItem (.ListIndex)
.ListIndex = -1
Call sumarhaber
End If
i=i-1
MsgBox "La operación ha sido eliminada!", vbInformation
Else
.ListIndex = -1
Exit Sub
End If
If .ListCount = Empty Then
Call OcultarBotonesEditarEliminar
End If
End With
End Sub
Private Sub btn_LimpiarItems_Click()
Call LimpiarControles("libro_diario", Me)
Call LimpiarItems
Call OcultarBotonesEditarEliminar
End Sub
Private Sub btn_Registrar_Click()
If Me.btn_Editar.Caption = "Guardar cambios" Then
MsgBox "Debe guardar los cambios realizados", vbInformation
Exit Sub
End If
If ControlesVacios("libro_diario", Me, Frame1, True) = True Then Exit Sub
If Me.chk_ISR.Value = True Then
Call CalcularRetencionISR
End If
If Me.chk_IVA.Value = True Then
Call CalcularIVA
End If
With Me
'Busca un item en el ListBox, que si está repetido, no permite agregarlo nuevamente
'obligando al usuario a seleccionar uno diferente
For i = 0 To .lbx_DebeHaber.ListCount - 1
If .lbx_DebeHaber.List(i, 0) = .cbo_CodCuenta Then
MsgBox "Esta cuenta ya se agregó, elija una diferente"
.lbx_DebeHaber.ListIndex = i
Exit Sub
End If
Next
.lbx_DebeHaber.AddItem .cbo_CodCuenta.Value
.lbx_DebeHaber.List(i, 1) = .txt_NombreCuenta.Text
If .opt_Cargar.Value = True Then
.lbx_DebeHaber.List(i, 2) = .txt_Monto.Value
Call sumarDebe
Else
.lbx_DebeHaber.List(i, 3) = .txt_Monto.Value
Call sumarhaber
End If
.lbx_DebeHaber.List(i, 4) = .txt_Concepto.Text
i=i+1
.lbx_DebeHaber.ListIndex = -1 'Elimina la selección del ListBox
End With
Call LimpiarControles("libro_diario", Me)
Call MostrarBotonesEditarEliminar
Me.chk_ISR.Value = False
Me.chk_IVA.Value = False
End Sub
For i = 0 To Me.lbx_DebeHaber.ListCount - 1
.Cells(Final, 3) = Me.lbx_DebeHaber.List(i, 4) ' Concepto
.Cells(Final, 4) = Me.lbx_DebeHaber.List(i, 0) ' Cuenta
.Cells(Final, 5) = Me.lbx_DebeHaber.List(i, 1) ' Nombre de Cuenta
' DEBE
Me.lbx_DebeHaber.List(i, 2) = _
Replace(Me.lbx_DebeHaber.List(i, 2), Application.ThousandsSeparator, "") ' Elimino el separador de miles
Me.lbx_DebeHaber.List(i, 2) = _
Replace(Me.lbx_DebeHaber.List(i, 2), Application.DecimalSeparator, ".") 'sustituyo el separador decimal
.Cells(Final, 6) = Me.lbx_DebeHaber.List(i, 2) ' Debe
.Cells(Final, 6).NumberFormat = "_($* #,##0.00_);_($* (#,##0.00);_($* ""-""??_);_(@_)"
' HABER
Me.lbx_DebeHaber.List(i, 3) = _
Replace(Me.lbx_DebeHaber.List(i, 3), Application.ThousandsSeparator, "") 'elimino el separador de miles
Me.lbx_DebeHaber.List(i, 3) = _
Replace(Me.lbx_DebeHaber.List(i, 3), Application.DecimalSeparator, ".") 'Sustituyo el separador decimal
Call LimpiarItems
Call CorrelativoPartidas
Call OcultarBotonesEditarEliminar
End Sub
Final = nReg(Hoja2, 2, 1) - 1
For Fila = 2 To Final
If Hoja2.Cells(Fila, 1) = Val(Me.cbo_CodCuenta) Then
encontrado = True
Me.txt_NombreCuenta = Hoja2.Cells(Fila, 2)
Exit For
End If
Next
If encontrado = False Then
Me.txt_NombreCuenta = Empty
End If
End Sub
Private Sub cbo_CodCuenta_Enter()
Dim Fila As Long
Dim Final As Long
Dim Lista As Long
Do While Me.cbo_CodCuenta.ListCount > 0
Me.cbo_CodCuenta.RemoveItem 0
Loop
Final = nReg(Hoja2, 2, 1) - 1
For Fila = 2 To Final
Lista = Hoja2.Cells(Fila, 1)
Me.cbo_CodCuenta.AddItem Lista
Next
End Sub
.AddItem nCodigoCta
.List(i, 1) = sNombreCta
.List(i, 2) = FormatNumber(-valorISR, 2)
.List(i, 4) = sConcepto
End If
i=i+1
End With
End Sub
.AddItem nCodigoCta1
.List(i, 1) = sNombreCta1
.List(i, 2) = FormatNumber(valorIVA, 2)
.List(i, 4) = sConcepto1
Else
nCodigoCta2 = 20201
sNombreCta2 = "IVA DÉBITO FISCAL 13%"
sConcepto2 = "DÉBITO FISCAL"
.AddItem nCodigoCta2
.List(i, 1) = sNombreCta2
.List(i, 3) = FormatNumber(valorIVA, 2)
.List(i, 4) = sConcepto2
.List(i, 4) = sConcepto2
End If
i=i+1
End With
End Sub
Me.chk_IVA.Visible = True
End Sub
LISTADO DE CUENTAS
Option Explicit
With frm_ListadoCuentas
For Fila = 2 To Final
.lbx_Cuentas.AddItem Hoja2.Cells(Fila, 1)
.lbx_Cuentas.List(.lbx_Cuentas.ListCount - 1, 1) = Hoja2.Cells(Fila, 2)
Next
End With
Call BuscarItemEnListBox
End Sub
Call CambiarTamanoListboxCuentas
Me.lbx_Cuentas.ColumnCount = 2
Me.lbx_Cuentas.ColumnWidths = "45 pt;150 pt"
End Sub
Dia = VBA.CLng(frmCalendario.lbl1.Caption)
Mes = VBA.CLng(frmCalendario.cboMes.Value)
Ano = VBA.CLng(frmCalendario.lblAno.Caption)
Unload frmCalendario
Call ModuloCalendario.RecibeLaFecha(Dia, Mes, Ano)
End If
End Sub
Private Sub lbl1_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal x As Single, ByVal Y As Single)
Dim Control_lbl1 As Control
Set Control_lbl1 = frmCalendario.lbl1
Call ModuloCalendario.MarcarDia(Control_lbl1)
End Sub
Private Sub lbl10_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal x As Single, ByVal Y As Single)
Dim Control_lbl10 As Control
Set Control_lbl10 = frmCalendario.lbl10
Call ModuloCalendario.MarcarDia(Control_lbl10)
End Sub
Private Sub lbl14_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal x As Single, ByVal Y As Single)
Dim Control_lbl14 As Control
Set Control_lbl14 = frmCalendario.lbl14
Call ModuloCalendario.MarcarDia(Control_lbl14)
End Sub
Private Sub lbl15_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
If frmCalendario.lbl15.Caption <> "-" Then
Dim Dia As Long, Mes As Long, Ano As Long
Dia = VBA.CLng(frmCalendario.lbl15.Caption)
Mes = VBA.CLng(frmCalendario.cboMes.Value)
Ano = VBA.CLng(frmCalendario.lblAno.Caption)
Unload frmCalendario
Call ModuloCalendario.RecibeLaFecha(Dia, Mes, Ano)
End If
End Sub
Private Sub lbl15_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal x As Single, ByVal Y As Single)
Dim Control_lbl15 As Control
Set Control_lbl15 = frmCalendario.lbl15
Call ModuloCalendario.MarcarDia(Control_lbl15)
End Sub
Dia = VBA.CLng(frmCalendario.lbl16.Caption)
Mes = VBA.CLng(frmCalendario.cboMes.Value)
Ano = VBA.CLng(frmCalendario.lblAno.Caption)
Unload frmCalendario
Call ModuloCalendario.RecibeLaFecha(Dia, Mes, Ano)
End If
End Sub
Private Sub lbl16_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal x As Single, ByVal Y As Single)
Dim Control_lbl16 As Control
Set Control_lbl16 = frmCalendario.lbl16
Call ModuloCalendario.MarcarDia(Control_lbl16)
End Sub
Dia = VBA.CLng(frmCalendario.lbl17.Caption)
Mes = VBA.CLng(frmCalendario.cboMes.Value)
Ano = VBA.CLng(frmCalendario.lblAno.Caption)
Unload frmCalendario
Call ModuloCalendario.RecibeLaFecha(Dia, Mes, Ano)
End If
End Sub
Private Sub lbl17_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal x As Single, ByVal Y As Single)
Dim Control_lbl17 As Control
Set Control_lbl17 = frmCalendario.lbl17
Call ModuloCalendario.MarcarDia(Control_lbl17)
End Sub
Dia = VBA.CLng(frmCalendario.lbl18.Caption)
Mes = VBA.CLng(frmCalendario.cboMes.Value)
Ano = VBA.CLng(frmCalendario.lblAno.Caption)
Unload frmCalendario
Call ModuloCalendario.RecibeLaFecha(Dia, Mes, Ano)
End If
End Sub
Private Sub lbl18_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal x As Single, ByVal Y As Single)
Dim Control_lbl18 As Control
Set Control_lbl18 = frmCalendario.lbl18
Call ModuloCalendario.MarcarDia(Control_lbl18)
End Sub
Dia = VBA.CLng(frmCalendario.lbl19.Caption)
Mes = VBA.CLng(frmCalendario.cboMes.Value)
Ano = VBA.CLng(frmCalendario.lblAno.Caption)
Unload frmCalendario
Call ModuloCalendario.RecibeLaFecha(Dia, Mes, Ano)
End If
End Sub
Private Sub lbl19_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal x As Single, ByVal Y As Single)
Dim Control_lbl19 As Control
Set Control_lbl19 = frmCalendario.lbl19
Call ModuloCalendario.MarcarDia(Control_lbl19)
End Sub
Unload frmCalendario
Call ModuloCalendario.RecibeLaFecha(Dia, Mes, Ano)
End If
End Sub
Private Sub lbl2_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal x As Single, ByVal Y As Single)
Dim Control_lbl2 As Control
Set Control_lbl2 = frmCalendario.lbl2
Call ModuloCalendario.MarcarDia(Control_lbl2)
End Sub
Dia = VBA.CLng(frmCalendario.lbl20.Caption)
Mes = VBA.CLng(frmCalendario.cboMes.Value)
Ano = VBA.CLng(frmCalendario.lblAno.Caption)
Unload frmCalendario
Call ModuloCalendario.RecibeLaFecha(Dia, Mes, Ano)
End If
End Sub
Private Sub lbl20_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal x As Single, ByVal Y As Single)
Dim Control_lbl20 As Control
Set Control_lbl20 = frmCalendario.lbl20
Call ModuloCalendario.MarcarDia(Control_lbl20)
End Sub
Unload frmCalendario
Call ModuloCalendario.RecibeLaFecha(Dia, Mes, Ano)
End If
End Sub
Private Sub lbl21_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal x As Single, ByVal Y As Single)
Dim Control_lbl21 As Control
Set Control_lbl21 = frmCalendario.lbl21
Call ModuloCalendario.MarcarDia(Control_lbl21)
End Sub
Private Sub lbl23_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal x As Single, ByVal Y As Single)
Dim Control_lbl23 As Control
Set Control_lbl23 = frmCalendario.lbl23
Call ModuloCalendario.MarcarDia(Control_lbl23)
End Sub
Private Sub lbl24_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal x As Single, ByVal Y As Single)
Dim Control_lbl24 As Control
Set Control_lbl24 = frmCalendario.lbl24
Call ModuloCalendario.MarcarDia(Control_lbl24)
End Sub
Dia = VBA.CLng(frmCalendario.lbl25.Caption)
Mes = VBA.CLng(frmCalendario.cboMes.Value)
Ano = VBA.CLng(frmCalendario.lblAno.Caption)
Unload frmCalendario
Call ModuloCalendario.RecibeLaFecha(Dia, Mes, Ano)
End If
End Sub
Private Sub lbl25_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal x As Single, ByVal Y As Single)
Dim Control_lbl25 As Control
Set Control_lbl25 = frmCalendario.lbl25
Call ModuloCalendario.MarcarDia(Control_lbl25)
End Sub
Dia = VBA.CLng(frmCalendario.lbl26.Caption)
Mes = VBA.CLng(frmCalendario.cboMes.Value)
Ano = VBA.CLng(frmCalendario.lblAno.Caption)
Unload frmCalendario
Call ModuloCalendario.RecibeLaFecha(Dia, Mes, Ano)
End If
End Sub
Private Sub lbl26_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal x As Single, ByVal Y As Single)
Dim Control_lbl26 As Control
Set Control_lbl26 = frmCalendario.lbl26
Call ModuloCalendario.MarcarDia(Control_lbl26)
End Sub
Private Sub lbl27_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal x As Single, ByVal Y As Single)
Dim Control_lbl27 As Control
Set Control_lbl27 = frmCalendario.lbl27
Call ModuloCalendario.MarcarDia(Control_lbl27)
End Sub
Call ModuloCalendario.MarcarDia(Control_lbl28)
End Sub
Unload frmCalendario
Call ModuloCalendario.RecibeLaFecha(Dia, Mes, Ano)
End If
End Sub
Private Sub lbl29_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal x As Single, ByVal Y As Single)
Dim Control_lbl29 As Control
Set Control_lbl29 = frmCalendario.lbl29
Call ModuloCalendario.MarcarDia(Control_lbl29)
End Sub
Dia = VBA.CLng(frmCalendario.lbl3.Caption)
Mes = VBA.CLng(frmCalendario.cboMes.Value)
Ano = VBA.CLng(frmCalendario.lblAno.Caption)
Unload frmCalendario
Call ModuloCalendario.RecibeLaFecha(Dia, Mes, Ano)
End If
End Sub
Private Sub lbl3_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal x As Single, ByVal Y As Single)
Dim Control_lbl3 As Control
Set Control_lbl3 = frmCalendario.lbl3
Call ModuloCalendario.MarcarDia(Control_lbl3)
End Sub
Call ModuloCalendario.MarcarDia(Control_lbl30)
End Sub
Dia = VBA.CLng(frmCalendario.lbl31.Caption)
Mes = VBA.CLng(frmCalendario.cboMes.Value)
Ano = VBA.CLng(frmCalendario.lblAno.Caption)
Unload frmCalendario
Call ModuloCalendario.RecibeLaFecha(Dia, Mes, Ano)
End If
End Sub
Private Sub lbl31_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal x As Single, ByVal Y As Single)
Dim Control_lbl31 As Control
Set Control_lbl31 = frmCalendario.lbl31
Call ModuloCalendario.MarcarDia(Control_lbl31)
End Sub
Dia = VBA.CLng(frmCalendario.lbl32.Caption)
Mes = VBA.CLng(frmCalendario.cboMes.Value)
Ano = VBA.CLng(frmCalendario.lblAno.Caption)
Unload frmCalendario
Call ModuloCalendario.RecibeLaFecha(Dia, Mes, Ano)
End If
End Sub
Private Sub lbl32_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal x As Single, ByVal Y As Single)
Dim Control_lbl32 As Control
Set Control_lbl32 = frmCalendario.lbl32
Call ModuloCalendario.MarcarDia(Control_lbl32)
End Sub
Dia = VBA.CLng(frmCalendario.lbl33.Caption)
Mes = VBA.CLng(frmCalendario.cboMes.Value)
Ano = VBA.CLng(frmCalendario.lblAno.Caption)
Unload frmCalendario
Call ModuloCalendario.RecibeLaFecha(Dia, Mes, Ano)
End If
End Sub
Private Sub lbl33_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal x As Single, ByVal Y As Single)
Dim Control_lbl33 As Control
Set Control_lbl33 = frmCalendario.lbl33
Call ModuloCalendario.MarcarDia(Control_lbl33)
End Sub
Dia = VBA.CLng(frmCalendario.lbl34.Caption)
Mes = VBA.CLng(frmCalendario.cboMes.Value)
Ano = VBA.CLng(frmCalendario.lblAno.Caption)
Unload frmCalendario
Call ModuloCalendario.RecibeLaFecha(Dia, Mes, Ano)
End If
End Sub
Private Sub lbl34_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal x As Single, ByVal Y As Single)
Dim Control_lbl34 As Control
Set Control_lbl34 = frmCalendario.lbl34
Call ModuloCalendario.MarcarDia(Control_lbl34)
End Sub
Dia = VBA.CLng(frmCalendario.lbl35.Caption)
Mes = VBA.CLng(frmCalendario.cboMes.Value)
Ano = VBA.CLng(frmCalendario.lblAno.Caption)
Unload frmCalendario
Call ModuloCalendario.RecibeLaFecha(Dia, Mes, Ano)
End If
End Sub
Private Sub lbl35_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal x As Single, ByVal Y As Single)
Dim Control_lbl35 As Control
Set Control_lbl35 = frmCalendario.lbl35
Call ModuloCalendario.MarcarDia(Control_lbl35)
End Sub
Private Sub lbl36_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
If frmCalendario.lbl36.Caption <> "-" Then
Dim Dia As Long, Mes As Long, Ano As Long
Dia = VBA.CLng(frmCalendario.lbl36.Caption)
Mes = VBA.CLng(frmCalendario.cboMes.Value)
Ano = VBA.CLng(frmCalendario.lblAno.Caption)
Unload frmCalendario
Call ModuloCalendario.RecibeLaFecha(Dia, Mes, Ano)
End If
End Sub
Private Sub lbl36_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal x As Single, ByVal Y As Single)
Dim Control_lbl36 As Control
Set Control_lbl36 = frmCalendario.lbl36
Call ModuloCalendario.MarcarDia(Control_lbl36)
End Sub
Dia = VBA.CLng(frmCalendario.lbl37.Caption)
Mes = VBA.CLng(frmCalendario.cboMes.Value)
Ano = VBA.CLng(frmCalendario.lblAno.Caption)
Unload frmCalendario
Call ModuloCalendario.RecibeLaFecha(Dia, Mes, Ano)
End If
End Sub
Private Sub lbl37_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal x As Single, ByVal Y As Single)
Dim Control_lbl37 As Control
Set Control_lbl37 = frmCalendario.lbl37
Call ModuloCalendario.MarcarDia(Control_lbl37)
End Sub
Dia = VBA.CLng(frmCalendario.lbl38.Caption)
Mes = VBA.CLng(frmCalendario.cboMes.Value)
Ano = VBA.CLng(frmCalendario.lblAno.Caption)
Unload frmCalendario
Call ModuloCalendario.RecibeLaFecha(Dia, Mes, Ano)
End If
End Sub
Private Sub lbl38_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal x As Single, ByVal Y As Single)
Dim Control_lbl38 As Control
Set Control_lbl38 = frmCalendario.lbl38
Call ModuloCalendario.MarcarDia(Control_lbl38)
End Sub
Dia = VBA.CLng(frmCalendario.lbl39.Caption)
Mes = VBA.CLng(frmCalendario.cboMes.Value)
Ano = VBA.CLng(frmCalendario.lblAno.Caption)
Unload frmCalendario
Call ModuloCalendario.RecibeLaFecha(Dia, Mes, Ano)
End If
End Sub
Private Sub lbl39_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal x As Single, ByVal Y As Single)
Dim Control_lbl39 As Control
Set Control_lbl39 = frmCalendario.lbl39
Call ModuloCalendario.MarcarDia(Control_lbl39)
End Sub
Dia = VBA.CLng(frmCalendario.lbl4.Caption)
Mes = VBA.CLng(frmCalendario.cboMes.Value)
Ano = VBA.CLng(frmCalendario.lblAno.Caption)
Unload frmCalendario
Call ModuloCalendario.RecibeLaFecha(Dia, Mes, Ano)
End If
End Sub
Private Sub lbl4_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal x As Single, ByVal Y As Single)
Dim Control_lbl4 As Control
Set Control_lbl4 = frmCalendario.lbl4
Call ModuloCalendario.MarcarDia(Control_lbl4)
End Sub
Dia = VBA.CLng(frmCalendario.lbl40.Caption)
Mes = VBA.CLng(frmCalendario.cboMes.Value)
Ano = VBA.CLng(frmCalendario.lblAno.Caption)
Unload frmCalendario
Call ModuloCalendario.RecibeLaFecha(Dia, Mes, Ano)
End If
End Sub
Private Sub lbl40_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal x As Single, ByVal Y As Single)
Dim Control_lbl40 As Control
Set Control_lbl40 = frmCalendario.lbl40
Call ModuloCalendario.MarcarDia(Control_lbl40)
End Sub
Dia = VBA.CLng(frmCalendario.lbl41.Caption)
Mes = VBA.CLng(frmCalendario.cboMes.Value)
Ano = VBA.CLng(frmCalendario.lblAno.Caption)
Unload frmCalendario
Call ModuloCalendario.RecibeLaFecha(Dia, Mes, Ano)
End If
End Sub
Private Sub lbl41_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal x As Single, ByVal Y As Single)
Dim Control_lbl41 As Control
Set Control_lbl41 = frmCalendario.lbl41
Call ModuloCalendario.MarcarDia(Control_lbl41)
End Sub
Dia = VBA.CLng(frmCalendario.lbl42.Caption)
Mes = VBA.CLng(frmCalendario.cboMes.Value)
Ano = VBA.CLng(frmCalendario.lblAno.Caption)
Unload frmCalendario
Call ModuloCalendario.RecibeLaFecha(Dia, Mes, Ano)
End If
End Sub
Private Sub lbl42_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal x As Single, ByVal Y As Single)
Dim Control_lbl42 As Control
Set Control_lbl42 = frmCalendario.lbl42
Call ModuloCalendario.MarcarDia(Control_lbl42)
End Sub
Private Sub lbl5_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
If frmCalendario.lbl5.Caption <> "-" Then
Dim Dia As Long, Mes As Long, Ano As Long
Dia = VBA.CLng(frmCalendario.lbl5.Caption)
Mes = VBA.CLng(frmCalendario.cboMes.Value)
Ano = VBA.CLng(frmCalendario.lblAno.Caption)
Unload frmCalendario
Call ModuloCalendario.RecibeLaFecha(Dia, Mes, Ano)
End If
End Sub
Private Sub lbl5_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal x As Single, ByVal Y As Single)
Dim Control_lbl5 As Control
Set Control_lbl5 = frmCalendario.lbl5
Call ModuloCalendario.MarcarDia(Control_lbl5)
End Sub
Private Sub lbl6_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal x As Single, ByVal Y As Single)
Dim Control_lbl6 As Control
Set Control_lbl6 = frmCalendario.lbl6
Call ModuloCalendario.MarcarDia(Control_lbl6)
End Sub
Private Sub lbl8_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal x As Single, ByVal Y As Single)
Dim Control_lbl8 As Control
Set Control_lbl8 = frmCalendario.lbl8
Call ModuloCalendario.MarcarDia(Control_lbl8)
End Sub
Private Sub lbl9_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal x As Single, ByVal Y As Single)
Dim Control_lbl9 As Control
Set Control_lbl9 = frmCalendario.lbl9
Call ModuloCalendario.MarcarDia(Control_lbl9)
End Sub
Else
End Function
Public Function LanzarCalendario(CualquierFormulario As Object, xTextBox As String)
Dim xCtrl As Control
Load frmCalendario
frmCalendario.Show
End Function
Load frm_ListadoCuentas
frm_ListadoCuentas.Show
End Function
Case 2
UserForm1.TextBox1.Text = Fecha
Case 3
UserForm1.TextBox2.Text = Fecha
Case Else
MsgBox "La petición solicitada, aún no se ha establecido dentro de la declaración SELECT CASE", vbCritical
End Select
End Function
MODULO CALENDARIO
Option Explicit
Option Private Module
Private SenalCambioMes As Long
With frmCalendario.cboMes
.AddItem 1
.List(0, 1) = "enero"
.AddItem 2
.List(1, 1) = "febrero"
.AddItem 3
.List(2, 1) = "marzo"
.AddItem 4
.List(3, 1) = "abril"
.AddItem 5
.List(4, 1) = "mayo"
.AddItem 6
.List(5, 1) = "junio"
.AddItem 7
.List(6, 1) = "julio"
.AddItem 8
.List(7, 1) = "agosto"
.AddItem 9
.List(8, 1) = "septiembre"
.AddItem 10
.List(9, 1) = "octubre"
.AddItem 11
.List(10, 1) = "noviembre"
.AddItem 12
.List(11, 1) = "diciembre"
End With
frmCalendario.cboMes.ListIndex = VBA.Month(VBA.Date) - 1
frmCalendario.spbAño.Value = VBA.Year(VBA.Date)
frmCalendario.lblAno.Caption = VBA.Year(VBA.Date)
Dim Ano As Long, Mes As Long
Ano = VBA.Year(VBA.Date)
Mes = VBA.Month(VBA.Date)
Call ModuloCalendario.CargarLosDias(Ano, Mes)
frmCalendario.lblHoy.Caption = VBA.Date
End Sub
Public Sub CargarLosDias(Ano As Long, Mes As Long)
Dim FechaDelPrimerDia As Date
Dim FechaDelUltimoDia As Date
Dim DiaSemanaPrimerDia As Long
Dim VariableControl As Control
Dim Contador As Long
FechaDelPrimerDia = VBA.DateSerial(Ano, Mes, 1)
FechaDelUltimoDia = Application.WorksheetFunction.EoMonth(VBA.DateSerial(Ano, Mes, 1), 0)
DiaSemanaPrimerDia = Application.WorksheetFunction.Weekday(FechaDelPrimerDia, 2)
Contador = 1
For Each VariableControl In frmCalendario.mrcDias.Controls
VariableControl.Caption = "-"
If VariableControl.Tag >= DiaSemanaPrimerDia And Contador <= VBA.Day(FechaDelUltimoDia) Then
VariableControl.Caption = Contador
Contador = Contador + 1
End If
Next VariableControl
End Sub
Sub DesmarcarDias()
Dim ControlEtiqueta As Control
Sub ValidarCuenta()
Dim Fila As Long
Dim Final As Long
Dim encontrado As Boolean
With frm_CatalogoCuentas
Final = nReg(Hoja1, 2, 1) - 1
Sub Run_CatalogoCuentas()
Load frm_CatalogoCuentas
frm_CatalogoCuentas.Show
End Sub
Sub Run_LibroDiario()
Load frm_LibroDiario
frm_LibroDiario.Show
End Sub
Sub CodCuentaATexto()
Dim Celda As Object
Dim miRangoDinamico As String
Dim Rango As Range
Dim Final As Long
Final = nReg(Hoja2, 2, 1) - 1
Hoja2.Range(miRangoDinamico).NumberFormat = "@"
Set Rango = Hoja2.Range(miRangoDinamico)
Sub CodCuentaANumero()
Dim Celda As Object
Dim miRangoDinamico As String
Dim Rango As Range
Dim Final As Long
Final = nReg(Hoja2, 2, 1) - 1
Hoja2.Range(miRangoDinamico).NumberFormat = "General"
End Sub
Sub IndexarCodCuentasPLAN()
Call CodCuentaATexto
Hoja2.Range("A:C").Sort key1:=Hoja2.Range("A2"), _
order1:=xlAscending, Header:=xlYes
Call CodCuentaANumero
End Sub
Sub InsertarCuentadesdeListBox()
If frm_ListadoCuentas.lbx_Cuentas.ListIndex = -1 Then
MsgBox "Debe seleccionar una cuenta", vbInformation
frm_ListadoCuentas.lbx_Cuentas.SetFocus
Exit Sub
End If
Case Else
MsgBox "La petición solicitada, aún no se ha establecido dentro de la declaración SELECT CASE", vbCritical
End Select
End Sub
Sub BuscarItemEnListBox()
Dim i As Long
Case 1
For i = 0 To frm_ListadoCuentas.lbx_Cuentas.ListCount - 1
If frm_ListadoCuentas.lbx_Cuentas.List(i, 0) = frm_CatalogoCuentas.cbo_CodCuenta Then
frm_ListadoCuentas.lbx_Cuentas.ListIndex = i
Exit For
End If
Next
Case 2
For i = 0 To frm_ListadoCuentas.lbx_Cuentas.ListCount - 1
If frm_ListadoCuentas.lbx_Cuentas.List(i, 0) = frm_LibroDiario.cbo_CodCuenta Then
frm_ListadoCuentas.lbx_Cuentas.ListIndex = i
Exit For
End If
Next
End Select
End Sub
Sub CambiarTamanoListboxCuentas()
If banderaListadoCuentas = 1 Then
frm_ListadoCuentas.Height = 125.25
frm_ListadoCuentas.lbx_Cuentas.Height = 75
End If
End Sub
Sub sumarDebe()
Dim item As Long
Dim totDebe As Currency
totDebe = 0
.lbx_DebeHaber.List(item, 2) = _
Replace(.lbx_DebeHaber.List(item, 2), ",", ".") 'Ahora sustituyo la coma decimal por el punto decimal, para
poder hacer la sumatoria con la variable totDebe, ya que con la coma decimal, no se suman los decimales
.lbx_DebeHaber.List(item, 2) = _
Replace(.lbx_DebeHaber.List(item, 2), ".", Application.DecimalSeparator) 'Aquí devuelvo el formato decimal
para que no afecte al ListBox
Next item
.lbl_SumaDebe.Caption = totDebe
.lbl_Diferencia.Caption = FormatNumber(.lbl_Diferencia.Caption, 2)
.lbl_SumaDebe.Caption = FormatNumber(.lbl_SumaDebe.Caption, 2)
.lbl_SumaHaber.Caption = FormatNumber(.lbl_SumaHaber.Caption, 2)
End With
End Sub
Sub sumarhaber()
Dim item As Long
Dim totHaber As Currency
With frm_LibroDiario
totHaber = 0
.lbx_DebeHaber.List(item, 3) = _
Replace(.lbx_DebeHaber.List(item, 3), Application.ThousandsSeparator, "") 'Aquí elimino el separador de
miles
.lbx_DebeHaber.List(item, 3) = _
Replace(.lbx_DebeHaber.List(item, 3), ",", ".") 'Ahora sustituyo la coma decimal por el punto decimal, para
poder hacer la sumatoria con la variable totHaber, ya que con la coma decimal, no se suman los decimales
.lbx_DebeHaber.List(item, 3) = _
Replace(.lbx_DebeHaber.List(item, 3), ".", Application.DecimalSeparator) 'Aquí devuelvo el formato decimal
para que no afecte al ListBox
Next item
.lbl_SumaHaber.Caption = totHaber
.lbl_Diferencia.Caption = FormatNumber(.lbl_Diferencia.Caption, 2)
.lbl_SumaDebe.Caption = FormatNumber(.lbl_SumaDebe.Caption, 2)
.lbl_SumaHaber.Caption = FormatNumber(.lbl_SumaHaber.Caption, 2)
End With
End Sub
Sub EnviarAMayor()
Dim ccCelda As Range, ccRango As Range
Dim ldCelda As Range, ldRango As Range
Dim lmFila As Long
Application.ScreenUpdating = False
Hoja4.Activate ' Libro Mayor
Cells.Select
Selection.Clear
lmFila = 2
Set ccRango = Hoja2.Range(Cells(2, 1), Cells(2, 1).End(xlDown)) 'Preparando el Rango del Catálogo de Cuentas
For Each ccCelda In ccRango ' Checando cada celda en el catálogo de cuentas Hoja2
If Len(ccCelda) = 3 Then
Set ldRango = Hoja3.Range(Cells(2, 4), Cells(2, 4).End(xlDown)) 'Preparando el Rango del Libro Diario
For Each ldCelda In ldRango
If ccCelda = Val(Mid(ldCelda.Offset(0, 0), 1, 3)) Then ' Comparo la CELDA de la hoja2 Catálogo de Cuentas,
con la Hoja3 Libro Diario.
' y escribo los datos en la hoj4 Libro Mayor
With Hoja4
.Cells(1, 1) = "CUENTA"
.Cells(1, 2) = "NOMBRE DE LA CUENTA"
.Cells(1, 3) = "#"
.Cells(1, 4) = "FECHA"
.Cells(1, 5) = "DEBE"
.Cells(1, 6) = "HABER"
lmFila = lmFila + 1
End If
Next ldCelda
End If
Next ccCelda
Call SepararCuentasMayor
Call SumarDebeMayor
Call SumarHaberMayor
Call LimpiarRepetidosMayor
Application.ScreenUpdating = True
End Sub
Sub SepararCuentasMayor()
Dim Fila As Long
Dim Final As Long
Hoja4.Activate
Final = nReg(Hoja4, 2, 1) - 2 ' Le resto 2, para que no inserte un encabezado sin datos al final
With Hoja4
For Fila = Final To 2 Step -1
If .Cells(Fila + 1, 1) <> .Cells(Fila, 1) Then
Rows(.Cells(Fila + 1, 1).Row & ":" & .Cells(Fila + 1, 1).Row + 1).Insert
.Cells(Fila + 2, 1) = "CUENTA"
.Cells(Fila + 2, 2) = "NOMBRE DE LA CUENTA"
.Cells(Fila + 2, 3) = "#"
.Cells(Fila + 2, 4) = "FECHA"
.Cells(Fila + 2, 5) = "DEBE"
.Cells(Fila + 2, 6) = "HABER"
.Range(.Cells(Fila + 2, 1), .Cells(Fila + 2, 6)).HorizontalAlignment = xlCenter
.Range(.Cells(Fila + 2, 1), .Cells(Fila + 2, 6)).Interior.Color = RGB(190, 190, 90)
.Range(.Cells(Fila + 2, 1), .Cells(Fila + 2, 6)).Font.Color = RGB(255, 255, 255)
.Range(.Cells(Fila + 2, 1), .Cells(Fila + 2, 6)).Font.Bold = True
End If
Next
End With
End Sub
Sub SumarDebeMayor()
Dim i As Long
Dim vDebe As Currency
Dim Final As Long
Hoja4.Range("A1").Activate
Final = ActiveCell.Row
Hoja4.Range("E2").Activate
Else
ActiveCell.Offset(1, 0).Select
End If
Next i
End Sub
Sub SumarHaberMayor()
Dim i As Long
Dim Final As Long
Dim vHaber As Currency
Hoja4.Range("A1").Activate
Hoja4.Range("F2").Activate
vHaber = 0
Next i
End Sub
Sub LimpiarRepetidosMayor()
Dim Fila As Long
Dim Final As Long
Hoja4.Range("A1").Activate
Final = ActiveCell.Row
Hoja4.Range("A1").Activate
End Sub
Sub ConstruirBalancedeComprobacion()
Dim ccCelda As Range, ccRango As Range
Dim ldCelda As Range, ldRango As Range
Dim bcFila As Long
Application.ScreenUpdating = False
Cells.Select
Selection.Clear
bcFila = 2
Set ccRango = Hoja2.Range(Cells(2, 1), Cells(2, 1).End(xlDown)) 'Preparando el Rango del Catálogo de Cuentas
bcFila = bcFila + 1
End If
Next ldCelda
End If
End With
Next ccCelda
Call SepararCuentasComprobacion
Call SumarDebeHaberComprobacion
Call ConsolidarBalanceComprobacion
Call TotalizarBalanceComprobacion
Application.ScreenUpdating = True
End Sub
Sub SepararCuentasComprobacion()
Dim Fila As Long
Dim Final As Long
Final = nReg(Hoja5, 2, 1) - 1
With Hoja5
For Fila = Final To 2 Step -1
If .Cells(Fila + 1, 1) <> .Cells(Fila, 1) Then
Rows(.Cells(Fila + 1, 1).Row & ":" & .Cells(Fila + 1, 1).Row).Insert
End If
Next
End With
End Sub
Sub SumarDebeHaberComprobacion()
Dim i As Long
Dim vDebeHaber As Currency
Dim sDeudor As Currency
Dim Final As Long
Dim j As Long
Hoja5.Range("A1").Activate
Final = ActiveCell.Row
For j = 3 To 5
Hoja5.Cells(2, j).Activate
If j = 5 And ActiveCell.Offset(0, -1) <> Empty Or ActiveCell.Offset(0, -2) <> Empty Then
Else
ActiveCell.Offset(1, 0).Select
End If
Next i
Next j
End Sub
Sub ConsolidarBalanceComprobacion()
Dim Fila As Long
Dim Final As Long
Hoja5.Range("A1").Activate
Do Until IsEmpty(ActiveCell)
ActiveCell.Offset(1, 0).Select
Loop
Final = ActiveCell.Row
End Sub
Sub TotalizarBalanceComprobacion()
Dim vTotalMoneda As Currency
Dim i As Long
Hoja5.Cells(2, i).Activate
vTotalMoneda = 0
ActiveCell.Value = vTotalMoneda
ActiveCell.NumberFormat = "_($* #,##0.00_);_($* (#,##0.00);_($* ""-""??_);_(@_)"
ActiveCell.Font.Bold = True
ActiveCell.Offset(1, 0).Select
Next i
Hoja5.Range("A1").Activate
End Sub
Sub BalanceGeneral()
Dim Celda As Range, Rango As Range, rBuscar As Range
Dim Fila As Long, ultFila As Long
Dim totACorriente As Currency, totAnoCorriente As Currency, totActivos As Currency
Dim totPCorriente As Currency, totPnoCorriente As Currency, totPatrimonio As Currency, totPasivos As Currency
Dim sEmpresa As String, FechaBalance As String, TipoMoneda As String
Dim fRepresentante As String, fContador As String, fAuditor As String
Application.ScreenUpdating = False
ultFila = 0
Fila = 7
With Hoja6
Set Rango = Hoja5.Range(Cells(2, 1), Cells(2, 1).End(xlDown)) 'Preparando el Rango del Balance de Comprobación
.Activate
.Cells(1, 1) = sEmpresa
.Cells(1, 1).Font.Bold = True
.Cells(1, 1).HorizontalAlignment = xlCenter
.Range(Cells(1, 1), Cells(1, 7)).Merge
.Cells(2, 1) = FechaBalance
.Cells(2, 1).Font.Bold = True
.Cells(2, 1).HorizontalAlignment = xlCenter
.Range(Cells(2, 1), Cells(2, 7)).Merge
.Cells(3, 1) = TipoMoneda
.Cells(3, 1).HorizontalAlignment = xlCenter
.Range(Cells(3, 1), Cells(3, 7)).Merge
.Cells(Fila - 2, 1) = "ACTIVO"
.Cells(Fila - 2, 1).HorizontalAlignment = xlCenter
.Range(Cells(Fila - 2, 1), Cells(Fila - 2, 3)).Merge
.Cells(Fila - 2, 1).Font.Bold = True
.Cells(Fila - 1, 1) = "Corriente"
.Cells(Fila - 1, 1).Font.Bold = True
totACorriente = 0
For Each Celda In Rango
If Mid(Celda, 1, 2) = 10 Or Mid(Celda, 1, 2) = 11 Then
.Cells(Fila, 1) = Celda.Offset(0, 1).Value 'Nombre de Cuenta
.Cells(Fila, 2) = Celda.Offset(0, 4).Value 'Saldo Deudor
.Cells(Fila, 2).NumberFormat = "_($* #,##0.00_);_($* (#,##0.00);_($* ""-""??_);_(@_)"
totACorriente = totACorriente + Celda.Offset(0, 4).Value
Fila = Fila + 1
End If
Next Celda
.Cells(Fila - 1, 2).Borders(xlEdgeBottom).Color = RGB(0, 0, 0)
Fila = Fila + 2
Fila = 7
.Cells(Fila - 2, 5) = "PASIVO"
.Cells(Fila - 2, 5).HorizontalAlignment = xlCenter
.Range(Cells(Fila - 2, 5), Cells(Fila - 2, 7)).Merge
.Cells(Fila - 2, 5).Font.Bold = True
.Cells(Fila - 1, 5) = "Corriente"
.Cells.Cells(Fila - 1, 5).Font.Bold = True
totPCorriente = 0
For Each Celda In Rango
If Mid(Celda, 1, 2) = 20 Then
.Cells(Fila, 5) = Celda.Offset(0, 1).Value 'Nombre de Cuenta
.Cells(Fila, 6) = Celda.Offset(0, 5).Value 'Saldo Acreedor
.Cells(Fila, 6).NumberFormat = "_($* #,##0.00_);_($* (#,##0.00);_($* ""-""??_);_(@_)"
totPCorriente = totPCorriente + Celda.Offset(0, 5).Value
Fila = Fila + 1
End If
Next Celda
.Cells(Fila - 1, 6).Borders(xlEdgeBottom).Color = RGB(0, 0, 0)
Fila = Fila + 2
Fila = Fila + 2
.Cells(Fila - 1, 5) = "Patrimonio"
.Cells(Fila - 1, 5).Font.Bold = True
totPatrimonio = 0
For Each Celda In Rango
If Mid(Celda, 1, 2) = 30 Or Mid(Celda, 1, 2) = 40 Then
.Cells(Fila, 5) = Celda.Offset(0, 1).Value 'Nombre de Cuenta
.Cells(Fila, 6) = Celda.Offset(0, 5).Value 'Saldo Acreedor
.Cells(Fila, 6).NumberFormat = "_($* #,##0.00_);_($* (#,##0.00);_($* ""-""??_);_(@_)"
totPatrimonio = totPatrimonio + Celda.Offset(0, 5).Value
Fila = Fila + 1
End If
Next Celda
.Cells(Fila - 1, 6).Borders(xlEdgeBottom).Color = RGB(0, 0, 0)
.Activate
.Range("A1").Select
'ThisWorkbook.Save
ultFila = .Cells.SpecialCells(xlCellTypeLastCell).Row + 3
ultFila = ultFila + 5
.Cells(ultFila, 1) = fRepresentante
.Cells(ultFila, 1).HorizontalAlignment = xlCenter
.Cells(ultFila, 3) = fContador
.Cells(ultFila, 3).HorizontalAlignment = xlCenter
.Range(Cells(ultFila, 3), Cells(ultFila, 4)).Merge
.Cells(ultFila, 6) = fAuditor
.Cells(ultFila, 6).HorizontalAlignment = xlCenter
.Range(Cells(ultFila, 6), Cells(ultFila, 7)).Merge
ultFila = ultFila + 1
.Cells(ultFila, 1) = "REPRESENTANTE LEGAL O APODERADO"
.Cells(ultFila, 1).HorizontalAlignment = xlCenter
.Cells(ultFila - 1, 1).Borders(xlEdgeTop).Color = RGB(0, 0, 0)
.Cells(ultFila, 3) = "CONTADOR GENERAL"
.Cells(ultFila, 3).HorizontalAlignment = xlCenter
.Range(Cells(ultFila, 3), Cells(ultFila, 4)).Merge
.Range(Cells(ultFila - 1, 3), Cells(ultFila, 4)).Borders(xlEdgeTop).Color = RGB(0, 0, 0)
.Cells(ultFila, 6) = "AUDITOR EXTERNO, REG.#"
.Cells(ultFila, 6).HorizontalAlignment = xlCenter
.Range(Cells(ultFila, 6), Cells(ultFila, 7)).Merge
.Range(Cells(ultFila - 1, 6), Cells(ultFila, 7)).Borders(xlEdgeTop).Color = RGB(0, 0, 0)
.btn_BalanceGeneral.Caption = "Limpiar"
End With
Application.ScreenUpdating = True
End Sub
SEPARADOR DECIMAL
Option Explicit
Dim Registro_Win As WshShell
Private Const MaquinaLocal As String = "HKEY_LOCAL_MACHINE"
Private Const UsuarioActual As String = "HKEY_CURRENT_USER"
Sub infoSeparadorDecimal()
Set Registro_Win = New WshShell
Sub Formato_Americano()
With Application
.UseSystemSeparators = False
.DecimalSeparator = "."
.ThousandsSeparator = ","
End With
End Sub
Sub Formato_Europeo()
With Application
.UseSystemSeparators = False
.DecimalSeparator = ","
.ThousandsSeparator = "."
End With
End Sub