Академический Документы
Профессиональный Документы
Культура Документы
Private Sub
CommandButton10_Click()
Sheets("FORMATO DE OT").Select
ult1 = (Cells(Rows.Count,
2).End(xlUp).Row)
ult1 = ult1 + 1
Cells(ult1, 2) = Label20
Cells(ult1, 3) = Label21
Cells(ult1, 4) = Label22
Cells(ult1, 5) = Label23
Cells(ult1, 6) = Label24
Cells(ult1, 7) = Label26
1
End Sub
End Sub
End Sub
dia = ComboBox1.Text
mes = ComboBox2.Text
año = ComboBox3.Text
diae = ComboBox4.Text
mese = ComboBox5.Text
añoe = ComboBox6.Text
If dia = "" Or mes = "" Or año = "" Or diae = "" Or mese = "" Or añoe = "" Then
MsgBox ("Ingrese todos los datos")
2
Else
respuesta = MsgBox("¿Los datos ingresados son correctos?", vbYesNo, "Confirmación de datos")
Select Case respuesta
Case vbYes
With Worksheets("FORMATO DE OT")
.Range("F3").Value = dia
.Range("G3").Value = mes
.Range("H3").Value = año
.Range("F4").Value = diae
.Range("G4").Value = mese
.Range("H4").Value = añoe
End With
Case vbNo
MsgBox "Vuelva a ingresar los datos"
End Select
End If
End Sub
CLIENTE = TextBox3.Text
OT = TextBox1
OC = TextBox2
End If
End Sub
End Sub
Sheets("Clientes").Select
ult = Cells(Rows.Count, 2).End(xlUp).Row
For n = 2 To ult
ComboBox7.AddItem (Cells(n, 2).Text)
Next n
'Case "ASTILLERO"
' ult = Cells(Rows.Count, 22).End(xlUp).Row
' For n = 2 To ult
' ComboBox8.AddItem (Cells(n, 22).Text)
' Next
'Case "METALMECÁNICA"
' ult = Cells(Rows.Count, 28).End(xlUp).Row
'For n = 2 To ult
' ComboBox8.AddItem (Cells(n, 28).Text)
' Next
'Case "MINERA"
' ult = Cells(Rows.Count, 43).End(xlUp).Row
' For n = 2 To ult
' ComboBox8.AddItem (Cells(n, 34).Text)
' Next
'Case "PESCA"
' ult = Cells(Rows.Count, 40).End(xlUp).Row
'For n = 2 To ult
'ComboBox8.AddItem (Cells(n, 40).Text)
' Next
'Case "FUNDICIÓN"
' ult = Cells(Rows.Count, 52).End(xlUp).Row
' For n = 2 To ult
' ComboBox8.AddItem (Cells(n, 52).Text)
' Next
'Case "HIDROSTÁTICA"
' ult = Cells(Rows.Count, 58).End(xlUp).Row
5
' For n = 2 To ult
' ComboBox8.AddItem (Cells(n, 58).Text)
' Next
'End Select
Sheets("Datos").Select
ult = Cells(Rows.Count, 1).End(xlUp).Row
For n = 2 To ult
ComboBox1.AddItem (Cells(n, 1).Text)
Next n
Sheets("Datos").Select
ult = Cells(Rows.Count, 2).End(xlUp).Row
For n = 2 To ult
ComboBox2.AddItem (Cells(n, 2).Text)
Next n
Sheets("Datos").Select
ult = Cells(Rows.Count, 3).End(xlUp).Row
For n = 2 To ult
ComboBox3.AddItem (Cells(n, 3).Text)
Next n
Sheets("Datos").Select
ult = Cells(Rows.Count, 1).End(xlUp).Row
For n = 2 To ult
ComboBox4.AddItem (Cells(n, 1).Text)
Next n
Sheets("Datos").Select
ult = Cells(Rows.Count, 2).End(xlUp).Row
For n = 2 To ult
ComboBox5.AddItem (Cells(n, 2).Text)
Next n
Sheets("Datos").Select
ult = Cells(Rows.Count, 3).End(xlUp).Row
For n = 2 To ult
ComboBox6.AddItem (Cells(n, 3).Text)
Next n
Sheets("Datos").Select
ult = Cells(Rows.Count, 4).End(xlUp).Row
For n = 2 To ult
ComboBox9.AddItem (Cells(n, 4).Text)
Next n
Sheets("Datos").Select
ult = Cells(Rows.Count, 5).End(xlUp).Row
6
For n = 2 To ult
ComboBox10.AddItem (Cells(n, 5).Text)
Next n
End Sub
End Sub
End Sub
7
x = 4 + CInt(TextBox1.Text) - 1
Cells(x, 1) = TextBox1.Text
Cells(x, 2) = TextBox2.Text
Cells(x, 3) = TextBox3.Text
Cells(x, 4) = TextBox4.Text
End If
Cells(x, 6) = TextBox5.Text
Cells(x, 7) = TextBox6.Text
Cells(x, 8) = TextBox7.Text
Cells(x, 9) = TextBox8.Text
Cells(x, 10) = TextBox9.Text
Unload UserForm2
End Sub
8
9
10
11
12