Excel - Ayuda con Combo box no sobre escriba la ultima fila donde hay datos

 
Vista:
sin imagen de perfil
Val: 1
Ha aumentado su posición en 4 puestos en Excel (en relación al último mes)
Gráfica de Excel

Ayuda con Combo box no sobre escriba la ultima fila donde hay datos

Publicado por Edgardo (1 intervención) el 13/05/2017 23:46:07
buenas tardes amigos un gusto saludarles, solicitando de su valiosa ayuda con mi aplicación en excel atraves de visual no logro que los datos ingresados en mis combo box no se sobre escriban al enviar otro nuevo ingreso de datos

este es lo que tengo al momento

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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
Dim i As Long
Option Explicit
Public Sub CommandButton1_Click()
Sheets("Base de datos").Activate
If fecha = "" Or numeroot = "" Or nombresocio = "" _
Or telefono = "" Or nodo = "" Then
MsgBox "Está dejando campos requeridos vacios favor complete", vbExclamation, "Datos solicitados por OTRS"
nombresocio.SetFocus
Else
 
'Declaración de variables
'
Dim strTitulo As String
Dim Continuar As String
Dim TransRowRng As Range
Dim NewRow As Integer
Dim Limpiar As String
Dim fila As Integer
Dim final As Integer
Dim i As Integer
Dim VAR2 As Integer
Dim VAR3 As Integer
 
 
 
 
 
'
strTitulo = "Atención Usuario OTRS"
'
Continuar = MsgBox("Dara de alta los datos?", vbYesNo + vbExclamation, "Atención Usuario OTRS")
If Continuar = vbNo Then Exit Sub
'
Set TransRowRng = ThisWorkbook.Worksheets("Base de datos").Cells(1, 1).CurrentRegion
NewRow = TransRowRng.Rows.Count + 1
With ThisWorkbook.Worksheets("Base de datos")
 
.Cells(NewRow, 1).Value = fecha.Value
.Cells(NewRow, 2).Value = fecha.Value
.Cells(NewRow, 3).Value = numeroot.Value
.Cells(NewRow, 4).Value = nombresocio.Value
.Cells(NewRow, 5).Value = tipoot.Value
.Cells(NewRow, 6).Value = empresa.Value
.Cells(NewRow, 7).Value = telefono.Value
.Cells(NewRow, 8).Value = nodo.Value
.Cells(NewRow, 9).Value = solucion.Value
.Cells(NewRow, 10).Value = estadoot.Value
.Cells(NewRow, 11).Value = nota.Value
.Cells(NewRow, 12).Value = motivo.Value
.Cells(NewRow, 13).Value = unidadmovil.Value
.Cells(NewRow, 14).Value = empleado1.Value
.Cells(NewRow, 15).Value = empleado2.Value
.Cells(NewRow, 16).Value = recibo.Value
.Cells(NewRow, 17).Value = mac.Value
.Cells(NewRow, 18).Value = series.Value
.Cells(NewRow, 19).Value = trabajosolo.Value
.Cells(NewRow, 20).Value = pagardoble.Value
.Cells(NewRow, 21).Value = comentariofinal.Value
 
 
Range("A" & Cells.Rows.Count).End(xlUp).Offset(1).Select
 
fila = 2
For i = 0 To cajamateriales.ListCount - 1
Hoja1.Cells(fila, 22).Value = cajamateriales.List(i, 0)
fila = fila + 1
Next
fila = 2
For i = 0 To cajamateriales.ListCount - 1
Hoja1.Cells(fila, 23).Value = cajacantidadmateriales.List(i, 0)
fila = fila + 1
Next
fila = 2
For i = 0 To cajalabores.ListCount - 1
Hoja1.Cells(fila, 24).Value = cajalabores.List(i, 0)
fila = fila + 1
Next
fila = 2
For i = 0 To cajacantidadlabores.ListCount - 1
Hoja1.Cells(fila, 25).Value = cajacantidadlabores.List(i, 0)
fila = fila + 1
 
Next
MsgBox "OT ingresada exitosamente", vbInformation, "Atención Usuario OTRS"
           cajamateriales.Clear 'Limpiamos el listbox
           i = 0 'reiniciamos el indice de registros del listbox
           listamateriales.SetFocus 'enviamos el foco al control
           cajalabores.Clear 'Limpiamos el listbox
           i = 0 'reiniciamos el indice de registros del listbox
           listalabores.SetFocus 'enviamos el foco al control
           cajacantidadlabores.Clear 'Limpiamos el listbox
           cajacantidadmateriales.Clear 'Limpiamos el listbox
 
 
fecha.Value = ""
numeroot.Value = ""
nombresocio.Value = ""
tipoot.Value = ""
empresa.Value = ""
telefono.Value = ""
nodo.Value = ""
solucion.Value = ""
estadoot.Value = ""
nota.Value = ""
motivo.Value = ""
unidadmovil.Value = ""
empleado1.Value = ""
empleado2.Value = ""
recibo.Value = ""
mac.Value = ""
series.Value = ""
trabajosolo.Value = ""
pagardoble.Value = ""
comentariofinal.Value = ""
cajamateriales.Value = ""
cajalabores.Value = ""
cantidadmateriales.Value = ""
cantidadlabores.Value = ""
listamateriales.Value = ""
listalabores.Value = ""
fecha.SetFocus
 
End With
 
End If
End Sub
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