Buen día estimado dando mas detalles yo tengo mi tabla donde guardo la información cuando llego a eso Combobox tengo los datos de la lista que se guardan los primeros dos que son PC y Operativo del combobox pero cuando selecciono la tercera opcion que es Otro me habilita o muestra el Textbox donde tengo que especificar la información, lo que deseo es que cuando seleccione otro la información que se guarde sea la del Textbox en lugar de la del Combobox en lugar le doy otro y escribo Sistema, Desarrollo se guarde lo que escribi no la opción OTRO.
Private Sub CommandButton1_Click()
On Error Resume Next
Dim Conttrol As Control
Dim UFila, X As Long
UFila = nReg(Hoja2, 2, 1)
If TextBox1 = Empty Or ComboBox1 = Empty Or TextBox2 = Empty Or TextBox3 = Empty Or ComboBox2 = Empty Or TextBox5 = Empty Or ComboBox3 = Empty Or TextBox6 = Empty _
Or TextBox8 = Empty Or ComboBox4 = Empty Or TextBox9 = Empty Or TextBox10 = Empty Or ComboBox5 = Empty Or ComboBox6 = Empty Or TextBox14 = Empty _
Or TextBox15 = Empty Or TextBox16 = Empty Or TextBox17 = Empty Or TextBox18 = Empty Or TextBox19 = Empty Or ComboBox7 = Empty Or ComboBox8 = Empty Then
MsgBox "ES NECESARIO LLENAR TODOS LOS CAMPOS", vbOKOnly + vbInformation, "AVISO"
TextBox1.SetFocus
Exit Sub
End If
If Mensaje = vbNo Then Exit Sub
cuenta = Application.WorksheetFunction.CountIf(Range("B:B"), TextBox1)
If cuenta > 0 Then
MsgBox "El ACTA '" & TextBox1 & "' SE ENCUENTRA REGISTRADA", vbExclamation, "SAMDA"
Else
Mensaje = MsgBox("DESEA INGRESAR LOS DATOS", vbQuestion + vbYesNo, "SAMDA")
If Mensaje = vbYes Then
Hoja2.Cells(UFila, 2) = TextBox1.Text
Hoja2.Cells(UFila, 3) = ComboBox1.Text
Hoja2.Cells(UFila, 4) = FECHA.Text
Hoja2.Cells(UFila, 5) = CDate(Format(TextBox2.Text, "dd/mm/yyyy"))
Hoja2.Cells(UFila, 6) = TextBox3.Text
If Hoja2.Cells(UFila, 7) = ComboBox2.Text = "Otro" Then
Hoja2.Cells(UFila, 7) = TextBox4.Text
Else
Hoja2.Cells(UFila, 7) = ComboBox2.Text
End If
Hoja2.Cells(UFila, 😎 = TextBox5.Text
Hoja2.Cells(UFila, 9) = ComboBox3.Text
Hoja2.Cells(UFila, 10) = TextBox6.Text
Hoja2.Cells(UFila, 11) = TextBox8.Text
Hoja2.Cells(UFila, 12) = ComboBox4.Text
Hoja2.Cells(UFila, 13) = TextBox9.Text
Hoja2.Cells(UFila, 14) = TextBox10.Text
Hoja2.Cells(UFila, 15) = ComboBox5.Text
Hoja2.Cells(UFila, 16) = TextBox11.Text
Hoja2.Cells(UFila, 17) = TextBox12.Text
Hoja2.Cells(UFila, 18) = ComboBox6.Text
Hoja2.Cells(UFila, 19) = TextBox14.Text
Hoja2.Cells(UFila, 20) = CDbl(Replace(TextBox15.Value, ",", "."))
Hoja2.Cells(UFila, 21) = CDbl(Replace(TextBox16.Value, ",", "."))
Hoja2.Cells(UFila, 22) = CDbl(Replace(TextBox17.Value, ",", "."))
Hoja2.Cells(UFila, 23) = CDbl(Replace(TextBox18.Value, ",", "."))
Hoja2.Cells(UFila, 24) = CDbl(Replace(TextBox19.Value, ",", "."))
Hoja2.Cells(UFila, 25) = ComboBox7.Text
Hoja2.Cells(UFila, 26) = ComboBox8.Text
Hoja2.Cells(UFila, 27) = TextBox20.Text
Hoja2.Cells(UFila, 28) = CDate(Format(TextBox21.Text, "dd/mm/yyyy"))
Hoja2.Cells(UFila, 29) = TextBox22.Text
Hoja2.Cells(UFila, 30) = TextBox23.Text
Hoja2.Cells(UFila, 31) = ComboBox10.Text
Hoja2.Cells(UFila, 32) = ComboBox11.Text
Hoja2.Cells(UFila, 33) = TextBox24.Text
Hoja2.Cells(UFila, 34) = CDate(Format(TextBox25.Text, "dd/mm/yyyy"))
'antes de limpiar, crear el registro en la hoja según el Combobox8
hojax = ComboBox8.Value
UFila = Sheets(hojax).Range("B" & Rows.Count).End(xlUp).Row + 1
With Sheets(hojax)
.Cells(UFila, 2) = TextBox1.Text
.Cells(UFila, 3) = ComboBox1.Text
.Cells(UFila, 4) = FECHA.Text
.Cells(UFila, 5) = CDate(Format(TextBox2.Text, "dd/mm/yyyy"))
.Cells(UFila, 6) = TextBox3.Text
If .Cells(UFila, 7) = ComboBox2.Text = "Otro" Then
.Cells(UFila, 7) = TextBox4.Text
Else
.Cells(UFila, 7) = ComboBox2.Text
End If
.Cells(UFila, 😎 = TextBox5.Text
.Cells(UFila, 9) = ComboBox3.Text
.Cells(UFila, 10) = TextBox6.Text
.Cells(UFila, 11) = TextBox8.Text
.Cells(UFila, 12) = ComboBox4.Text
.Cells(UFila, 13) = TextBox9.Text
.Cells(UFila, 14) = TextBox10.Text
.Cells(UFila, 15) = ComboBox5.Text
.Cells(UFila, 16) = TextBox11.Text
.Cells(UFila, 17) = TextBox12.Text
.Cells(UFila, 18) = ComboBox6.Text
.Cells(UFila, 19) = TextBox14.Text
.Cells(UFila, 20) = CDbl(Replace(TextBox15.Value, ",", "."))
.Cells(UFila, 21) = CDbl(Replace(TextBox16.Value, ",", "."))
.Cells(UFila, 22) = CDbl(Replace(TextBox17.Value, ",", "."))
.Cells(UFila, 23) = CDbl(Replace(TextBox18.Value, ",", "."))
.Cells(UFila, 24) = CDbl(Replace(TextBox19.Value, ",", "."))
.Cells(UFila, 25) = ComboBox7.Text
.Cells(UFila, 26) = ComboBox8.Text
.Cells(UFila, 27) = TextBox20.Text
.Cells(UFila, 28) = CDate(Format(TextBox21.Text, "dd/mm/yyyy"))
.Cells(UFila, 29) = TextBox22.Text
.Cells(UFila, 30) = TextBox23.Text
.Cells(UFila, 31) = ComboBox10.Text
.Cells(UFila, 32) = ComboBox11.Text
.Cells(UFila, 33) = TextBox24.Text
.Cells(UFila, 34) = CDate(Format(TextBox25.Text, "dd/mm/yyyy"))
End With
MsgBox "DATOS INGRESADOS", vbInformation
'Call Limpiar
Call Actualizar
ThisWorkbook.Save
TextBox1.SetFocus
Call UserForm_Initialize
Else
MsgBox "OPERACION CANCELA", vbExclamation
Call Limpiar
TextBox1.SetFocus
End If
End If
'ThisWorkbook.Save
Call Limpiar
End Sub
Es el codigo donde guardo la información