Hola Dante, muchas gracias por tu atención.
Los combos se cargan de la Hoja3.
El código de mi macro es el siguiente:
Private Sub CONTROL_Click()
Unload INGRE_REG
Load Control_Archivos
Control_Archivos.Show
End Sub
Private Sub boton_modif_Click()
Unload Me
MODI_REG.Show
End Sub
Private Sub Solo_Orig_Click()
Unload Me
REG_ORIG.Show
End Sub
Private Sub CommandButton1_Click()
Application.ScreenUpdating = False
Sheets("2017").Activate
If TextBox1 = "" Then
MsgBox "Está dejando campos requeridos vacios por favor completelos", vbExclamation, "Registro"
TextBox1.SetFocus
Else
Set b = Sheets("2017").Columns("A").Find(TextBox1, lookat:=xlWhole)
If Not b Is Nothing Then
MsgBox "LA OS YA EXISTE", vbExclamation, "Registro"
Exit Sub
End If
Range("A" & Cells.Rows.Count).End(xlUp).Offset(1).Select
ActiveCell.Offset(0, 0) = TextBox1.Value
ActiveCell.Offset(0, 1) = ComboBox1.Value
ActiveCell.Offset(0, 2) = TextBox2.Value
ActiveCell.Offset(0, 3) = TextBox3.Value
ActiveCell.Offset(0, 4) = TextBox4.Value
ActiveCell.Offset(0, 5) = TextBox5.Value
ActiveCell.Offset(0, 6) = ComboBox2.Value
ActiveCell.Offset(0, 7) = ComboBox3.Value
ActiveCell.Offset(0, 8) = TextBox6.Value
ActiveCell.Offset(0, 9) = TextBox7.Value
ActiveCell.Offset(0, 10) = TextBox8.Value
ActiveCell.Offset(0, 11) = TextBox9.Value
ActiveCell.Offset(0, 12) = TextBox10.Value
ActiveCell.Offset(0, 13) = TextBox11.Value
ActiveCell.Offset(0, 14) = TextBox12.Value
ActiveCell.Offset(0, 15) = TextBox13.Value
ActiveCell.Offset(0, 16) = TextBox14.Value
ActiveCell.Offset(0, 17) = TextBox15.Value
ActiveCell.Offset(0, 18) = TextBox16.Value
ActiveCell.Offset(0, 19) = TextBox17.Value
MsgBox "Registro ingresado exitosamente", vbInformation, "Registro"
TextBox1.SetFocus
End If
Hoja3.Select
Set b = Hoja3.Columns("A").Find(ComboBox2) 'buscar el cliente si exite no hace nada
If Not b Is Nothing Then
Else
Range("A" & Cells.Rows.Count).End(xlUp).Offset(1).Select 'si no exite lo crea en la hoja de control de combo
ActiveCell.Offset(0, 0) = ComboBox2.Value
MsgBox "Nuevo Cliente Ingresado", vbInformation, "Registro"
End If
Hoja1.Select
LIMPI_REG
Application.ScreenUpdating = True
End Sub
Private Sub CommandButton4_Click()
Unload Me
End Sub
Private Sub CommandButton6_Click()
Unload Me
ELIM_REG.Show
End Sub
Private Sub UserForm_Initialize()
Application.ScreenUpdating = False
Hoja3.Select
Range("A2").Select
Do While ActiveCell <> Empty
ComboBox2.AddItem ActiveCell.Value
ActiveCell.Offset(1, 0).Select
Loop
Range("B2").Select
Do While ActiveCell <> Empty
ComboBox3.AddItem ActiveCell.Value
ActiveCell.Offset(1, 0).Select
Loop
Range("C2").Select
Do While ActiveCell <> Empty
ComboBox1.AddItem ActiveCell.Value
ActiveCell.Offset(1, 0).Select
Loop
Hoja1.Select
Application.ScreenUpdating = True
End Sub
Private Sub CommandButton8_Click()
ThisWorkbook.ActiveSheet.Copy before:=Workbooks.Add.Worksheets(1)
ActiveSheet.Shapes.Range(Array("1 Rectángulo")).Select
Selection.Delete
ActiveSheet.Shapes.Range(Array("1 Rectángulo")).Select
Selection.Delete
ActiveSheet.Shapes.Range(Array("1 Rectángulo")).Select
Selection.Delete
ActiveWorkbook.Close (1)
End Sub
Private Sub Limpiar_Click()
LIMPI_REG
End Sub