Visual Basic para Aplicaciones - codigo copiar datos no funciona

Life is soft - evento anual de software empresarial
 
Vista:
sin imagen de perfil

codigo copiar datos no funciona

Publicado por Edmund (17 intervenciones) el 16/03/2014 06:36:23
Hola:
Tengo un código que utilizo para copiar datos de un formulario a una tabla, sin embargo cuando quiero que funcione en otro formato y tabla no me funciona, a pesar de haber modificado lo que según yo necesita. Me gustaría por favor me ayuden a solucionar donde tengo el error.
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
Sub GuardaNuevoProv()
'AGREGA UN NUEVO PROVEEDOR AL MAESTRO.
On Error GoTo hojaerror
Application.ScreenUpdating = False
If [D3] = "" Or [D5] = "" Or [D7] = "" Then
MsgBox "No deje vacío, ningún campo marcado * como obligatorio ", vbExclamation + vbOKOnly, "CAMPO VACIO"
[D3].Select
Application.ScreenUpdating = True
        Exit Sub
    End If
 
Application.ScreenUpdating = False
With Sheets("PROVEEDORES")
    x = 3
    rw = .Range("A1:A1048576").Find("").Row
For a = 1 To 5
    .Cells(rw, a) = Cells(x, 4)
    x = x + 2
Next a
End With
Sheets("ForPROVEEDORES").Select
[D3,D5:H5,D7:H7,D9,D11:H11].ClearContents
[D3].Select
Application.ScreenUpdating = True
 
Exit Sub
 
hojaerror:
MsgBox Err.Description, vbCritical + vbOKOnly, "ERROR"
 
Application.ScreenUpdating = True
 
 
End Sub
Sub GuardaNuevoClient()
'AGREGA UN NUEVO CLIENTE AL MAESTRO.
On Error GoTo hojaerror
Application.ScreenUpdating = False
If [D4] = "" Or [D6] = "" Or [D8] = "" Or [D10] = "" Then
MsgBox "No deje vacío, ningún campo marcado * como obligatorio ", vbExclamation + vbOKOnly, "CAMPO VACIO"
[D4].Select
Application.ScreenUpdating = True
        Exit Sub
    End If
 
Application.ScreenUpdating = False
 
With Sheets("CLIENTES")
    x = 4
    rw = .Range("A1:A1048576").Find("").Row
For a = 1 To 8
    .Cells(rw, a) = Cells(x, 7)
    x = x + 2
Next a
End With
 
Sheets("ForCLIENTES").Select
[D4,D6:H6,D8:H8,D10:H10,D12,D14,D16:H16,D18:H18].ClearContents
 
[D4].Select
 
Application.ScreenUpdating = True
 
Exit Sub
 
hojaerror:
MsgBox Err.Description, vbCritical + vbOKOnly, "ERROR"
 
Application.ScreenUpdating = True
 
End Sub
De antemano muy agradecido..!!!
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder