Está en la página 1de 4

Next contador

Sendkeys {ESC}
sumas:
Range(C6).Select
totalimpor = 0
Cells(plazentrado + 7,2).Select
Set seleccionActual = Application.ActiveCell
seleccionActual.Value = TOTALES:
Range(C6).Select
For contador = 1 To plazentrado
Cells(contador + 3,5).Select
Importe1 = ActiveCell
totalimpor = totalimpor + importe1
Next contador
Cells(plazentrado + 7,3).Select
Set seleccionActual = Application.ActiveCell
seleccionActual.Value = totalimpor
Suma2:
Range(D6).Select
totalimpor = 0
For contador = 1 To plazentrado
Cells(contador + 5,4).Select
Importe1 = ActiveCell
totalimpor = totalimpor + importe1
Next contador
Cells(plazentrado + 7,3).Select
Set seleccionActual = Application.ActiveCell
seleccionActual.Value = totalimpor

Suma3:
Range(E6).Select
totalimpor = 0
For contador = 1 To plazentrado
Cells(contador + 5,5).Select
Importe1 = ActiveCell
totalimpor = totalimpor + importe1
Next contador
Cells(plazentrado + 7,5).Select
Set seleccionActual = Application.ActiveCell
seleccionActual.Value = totalimpor
acabar:
Sheets(Hoja1).Select
Columns(C:F).Select
Selection.NumberFormat = # , # # 0.00
Range(A1).Select
End Sub
BOTON FECHAS
Sub FECHAS()
Sheets(Hoja1).Select
Range(A1).Select
ActiveScheet.PrintPreview
Range(A1).Select
End Sub

Sub Auto_open()
Sheets(Hoja1).Select
Range(A1).Select
Mensaje = Calculo de prstamos & Chr$(10) & CAJA TERCERO B
Estilo = vbOKOnly
Titulo = INICIO
Respuesta = MsgBox(Mensaje, Estilo, Titulo)
End Sub
Sub Auto_close()
Sheets(Hoja1).Select
Range(A1).Select
Mensaje = Calculo de prstamos & Chr$(10) & CAJA TERCERO B
Estilo = vbOKOnly
Titulo = FINALIZACION
Respuesta = MsgBox(Mensaje, Estilo, Titulo)
End Sub
BOTON IMPRESIN
Sub IMPRESIN()
Sheets(Hoja1).Select
Range(A1).Select
Entfech
Mensaje1 = INTRODUZCA LA FECHA DEL PRIMER PLAZO
Titulo1 = ENTRADA FECHA
Estandar1 = Date
Fechaentrada = inputBox(Mensaje1, titulo1, Estandar1)
If IsDate(fechaentrada) = False Then GoTo entfech
Seguir:
Range(A6).Select
dia = Day(fechaentrada)
mes = Month(fechaentrada)
ao = Year(fechaentrada)
For contador = 1 To plazentrado
fechaplazo = fechaentrada
Cells(contador + 5,1).Select
ActiveCell.Value = DateSerial(ao, mes, dia)
mes = mes + 1
If mes= 13 Then
mes = 1
ao = ao + 1
End If
fechaentrada = DateSerial(ao, mes, dia)
If mes = 2 Then
If dia > 28 Then
dia2 = 28
fechaentrada = DateSerial(ao, mes, dia)
End If
resto = ao Mod 4
If resto = o Then
If dia > 28 Then
dia 2 = 29
fechaentrada = DateSerial(ao, mes, dia)
End If
End If
End If
If mes = 4 Or mes = 6 Or mes = 9 Or mes = 11 Then
If dia > 30 Then
dia 2 = 30
fechaentrada = DateSerial(ao, mes, dia)
End If
End If
Next contador
Range(A1).Select
End Sub

También podría gustarte