
SOLICITUD CORREGIR ERROR 1004
Publicado por LUIS BENITEZ (1 intervención) el 25/08/2017 19:01:56
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
Sub Proceso()
Dim Ultlinea As Long
Dim Ultlineadatos As Long
Dim Codigo, Descripcion, Fecha, Cantidad, Movimiento As String
Dim BusquedaFiladatos As Range
Dim Rangobusqueda As String
Dim Filaregistro As Long
Codigo = Sheets("VENTAS").Cells(7, 3)
Descripcion = Sheets("VENTAS").Cells(7, 4)
Fecha = Sheets("VENTAS").Cells(7, 5)
Cantidad = Sheets("VENTAS").Cells(7, 6)
Movimiento = Sheets("VENTAS").Cells(7, 7)
If Len(Codigo) = 0 Or Len(Descripcion) = 0 Or Len(Fecha) = 0 Or Len(Cantidad) = 0 Or Len(Movimiento) = 0 Then
MsgBox "Debe Ingresar Todos Los Campos", Vbacritical, "Resultado"
Exit Sub
End If
'Range(Range(“A & ActiveCell.Row), Range(“IV” & ActiveCell.Row).End(xlToLeft)).Select
Ultlinea = Sheets("VENTAS").Range("G" & Rows.Count).End(Exlup).Row
Sheets("VENTAS").Cells(Ultlinea + 1, 7) = Codigo
Sheets("VENTAS").Cells(Ultlinea + 1, 8) = Descripcion
Sheets("VENTAS").Cells(Ultlinea + 1, 9) = Fecha
Sheets("VENTAS").Cells(Ultlinea + 1, 10) = Cantidad
Sheets("VENTAS").Cells(Ultlinea + 1, 11) = Movimiento
Ultlineadatos = Sheets("VENTAS").Range("A" & Rows.Count).End(Exlup).Row
Rangobusqueda = "A12:A" & Ultlineadatos
Set BusquedaFiladatos = Sheets("VENTAS").Range(Rangobusqueda).Find(Codigo, Lookatl * X1whole)
If BusquedaFiladatos Is Nothing Then
MsgBox "El Codigo Ingresado No Existe", Vbacritical, "Resultado"
Exit Sub
Else
Filaregistro = BusquedaFiladatos.Row
If Movimiento = "Entradas" Then
Sheets("VENTAS").Cells(Filaregistro, 3) = Sheets("VENTAS").Cells(Filaregistro, 4) + Cantidad
Else
Sheets("VENTAS").Cells(Filaregistro, 4) = Sheets("VENTAS").Cells(Filaregistro, 4) + Cantidad
Sheets("VENTAS").Cells(Filaregistro, 4) = Sheets("VENTAS").Cells(Filaregistro, 3) - Sheets("VENTAS").Cells(Filaregistro, 4)
Sheets("VENTAS").Cells(7, 3) = " "
Sheets("VENTAS").Cells(7, 4) = " "
Sheets("VENTAS").Cells(7, 5) = " "
Sheets("VENTAS").Cells(7, 6) = " "
Sheets("VENTAS").Cells(7, 7) = " "
MsgBox "Actualizacion Exitosa", Vbacritical, "Resultado"
Sheets("VENTAS").Range("C7").Select
End If
End If
End Sub
Valora esta pregunta


-1