lunes, 6 de mayo de 2013

asdgf

asdf

FACTURA


FACTURACION:
NIT:

Private Sub NIT_Change()
Sheets("Clientes").Select
Range("A1").Select

On Error Resume Next
    Cells.Find(What:=NIT.value, After:=ActiveCell, LookIn:=xlFormulas, _
    LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
    MatchCase:=False, SearchFormat:=False).Activate

    comparation.Caption = ActiveCell

If comparation.Caption = NIT.value Then
    Selection.Offset(, -2).Select
    NOMBRE.value = ActiveCell
    Selection.Offset(, 1).Select
    DIRECCION.value = ActiveCell
End If

FECHA
FECHA = Date

CANTIDAD:

On Error Resume Next
If COD1.value <> Empty Then
    EXIS1.value = EXIS1.value - CANT1.value
    SUB1.value = PREC1.value * CANT1.value
    GUARDAR.SetFocus
        Sheets("DATA_BASE").Select
        ActiveCell.Offset(0, 0).Select
         ActiveCell = EXIS1.value
          End If


CODIGO1:

If COD1 > 6000 Then
    Sheets("DATA_BASE").Select

    On Error Resume Next
    Cells.Find(What:=COD1.value, After:=ActiveCell, LookIn:=xlFormulas, _
    LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
    MatchCase:=False, SearchFormat:=False).Activate

    ActiveCell.Offset(0, 1).Select
    PROD1 = ActiveCell
    ActiveCell.Offset(0, 1).Select
    PREC1 = ActiveCell
    ActiveCell.Offset(0, 1).Select
    EXIS1 = ActiveCell

    CANT1.SetFocus

MENU

UserForm1.Hide
UserForm2.Show

CANCELAR:
UserForm1.Hide

LIMPIAR FACTURA:
Sheets("factura").Select
Range("A20:E34").Select
    ActiveWindow.SmallScroll Down:=-9
    Range("A20:E34,B13:C13,B15:C15,B17:C17,E11,E13").Select
    Range("E13").Activate
    Selection.ClearContents
    
   NIT = Empty

IMPRIMIR
Sheets("Factura").Select
Range("B12").Select

If comparation.Caption = NIT.value Then
    Range("B13").Select
    Do While Not IsEmpty(ActiveCell)
        ActiveCell.Offset(1, 0).Select
    Loop
    
    ActiveCell = NOMBRE.value
    ActiveCell.Offset(0, 1).Select
    ActiveCell.Offset(0, 1).Select
    ActiveCell = NIT.value
      End If
    
Sheets("Factura").Select
Range("E11").Select
ActiveCell = NOFAC.Caption
Range("B13").Select
ActiveCell = NOMBRE.value
Range("E13").Select
ActiveCell = NIT.value
Range("B15").Select
ActiveCell = DIRECCION.value
Range("B17").Select
ActiveCell = FECHA.value

MsgBox "La Factura ah sido Impresa con Éxito", vbOKOnly, "Resultado"

[AA1] = [AA1] + 1

GUARDAR:
Sheets("Factura").Select
Range("A20").Select

Do While Not IsEmpty(ActiveCell)
    ActiveCell.Offset(1, 0).Select
Loop

ActiveCell = COD1.value
ActiveCell.Offset(0, 1).Select
ActiveCell = PROD1.value
ActiveCell.Offset(0, 1).Select
ActiveCell = PREC1.value
ActiveCell.Offset(0, 1).Select
ActiveCell = CANT1.value
ActiveCell.Offset(0, 1).Select
ActiveCell = SUB1.value


COD1 = Empty
PROD1 = Empty
PREC1 = Empty
CANT1 = Empty
SUB1 = Empty
EXIS1 = Empty
COD1.SetFocus


Factura Corta

INGRESAR
USUARIO:

usuario.Text = ""
usuario.ForeColor = &HC00000



CONTRASEÑA:

Private Sub contraseña_MouseDown(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
contraseña.Text = ""
contraseña.ForeColor = &HC00000
contraseña.PasswordChar = "*"

If usuario.Text = "Usuario" Or usuario.Text = "" Then
MsgBox "Debe Ingresar Usuario", vbCritical, "Atencion"
End If



BOTON ENTRAR:

If usuario.Text = "JosyL." And contraseña.Text = "2511" Then
MsgBox "Bienvenido", vbInformation, "Felicitaciones"

INGRESAR.Hide
UserForm2.Show
Else
MsgBox "Contraseña o Usuario Incorrecto", vbCritical, "Alerta"
End If



MENU

INGRESAR PRODUCTO: 
UserForm2.Hide
REGISTRO.Show


FACTURACION:

UserForm2.Hide
UserForm1.Show


INGRESO DE PRODUCTOS:
GUARDAR:

Sheets("DATA_BASE").Select

On Error Resume Next
    Cells.Find(What:=codigo, After:=ActiveCell, LookIn:=xlFormulas, _
    LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
    MatchCase:=False, SearchFormat:=False).Activate

    comparation.Caption = ActiveCell

If comparation.Caption = codigo Or codigo = Empty Then
    MsgBox "ESTE CODIGO YA EXISTE!", vbOKOnly, "ALERTA!!"
    codigo = Empty
    codigo.SetFocus
Else
    Range("A2").Select
    Do While Not IsEmpty(ActiveCell)
        ActiveCell.Offset(1, 0).Select
    Loop
 
    ActiveCell = codigo.value
    ActiveCell.Offset(0, 1).Select
    ActiveCell = name1.value
    ActiveCell.Offset(0, 1).Select
    ActiveCell = value.value
    ActiveCell.Offset(0, 1).Select
    ActiveCell = excis.value
 
    ActiveWorkbook.Save
    MsgBox "SUS DATOS HAN SIDO INGRESADO!!", vbOKOnly, "!CONGRATULATION!"
 
    codigo = Empty
    name1 = Empty
    value = Empty
    excis = Empty
    name1.SetFocus

End If

REGRESAR:

REGISTRO.Hide
UserForm2.Show

martes, 26 de febrero de 2013

Boleta de notas

En la Primera hoja se realiza realiza el modelo de la boleta de la hoja:






se le da nombre a las hojas las cuales utilizaremos:




se crea la base de los alumnos:

ala celda donde esta el grado  y la carrera se le cambia de nombre ya que haci sera mas facil extraer para la boleta:

seleccionando todas las hojas donde estan uvicada las clases, se le da el formato:
todo sera extraido a base de la clave, se utilizara la funcion =Indice(alumnos;"clave")

son cuatro hojas mas por bimestre y una de promedio.
cada bimestre de cada matareia se guarda con un nombre el cual sea similar para que se pueda recordar,
EJEMPLO:
=INDICE(Ingbim1;A6)
el ingbim 1 es el nombre del curso de ingles y bimestre1, a6 la celda donden esta la clave.
se hace esto en todos los bimestres pero solo va cambiando de ingbim1, por el ingbim2 y ingbim3.
cuando se termina se le saca el promedio de cada alumo,
ejemplo:
=PROMEDIO(b2:e2)

PARA LA HOJA DE PROMEDIO:
a cada promedio final de alunmo se le pone un nombre por ejemplo "prombin1"
y se extrae con la formula =INDICE(prombim1;a7)
prombim1 es el nombre dela fila de promedios del primer bimestre y a7 la celda de la clave.