Fórmula para una celda que solo permita cierta cantidad de caracteres a otra
Interesante Fórmula tuya
=IZQUIERDA(B1;127)
Quisiera que me dieras la solución para integrar a una macro, para que en la celda D46 solo reciba los 125 caracteres aunque en la caja del formulario se escriban 500. Esta la macro tu conocida.
Private Sub cmbInsertar_Click()
'Obligar a llenar las cajas del 6 al 9
Dim vcs, vtx, i, LastRow
' vcs = Array("TextBox6", "Textbox7", "Textbox8", "Textbox9")
' vtx = Array("CANTIDAD", "# DE PRODUCTO", "DESCRIPCION DEL PRODUCTO", "# DE PAGINA")
' For i = LBound(vcs) To UBound(vcs)
' If Me.Controls(vcs(i)) = Empty Then
' MsgBox "DEBES INTRODUCIR: " & vtx(i), vbExclamation, "LLENAR LISTA"
' Exit Sub
' End If
' Next
'Inserta datos en la hoja
Range("C8").Value = TextBox6.Value 'Fecha
Range("E8").Value = TextBox7.Value 'Nombre Empresa
Range("I8").Value = TextBox8.Value 'Repuestos para
Range("D9").Value = TextBox9.Value 'Serial Maq/Mot.
Range("G9").Value = TextBox10.Value 'Marca
Range("K9").Value = TextBox11.Value 'Modelo/Ident.
Range("D46").Value = TextBox12.Value 'Notas
'
LastRow = Range("b" & Rows.Count).End(xlUp).Row
Range("B" & LastRow + 1).Value = TextBox1.Value 'Item #
Range("C" & LastRow + 1).Value = TextBox2.Value 'Producto #
Range("D" & LastRow + 1).Value = TextBox3.Value 'Descripcion del Producto
Range("J" & LastRow + 1).Value = TextBox4.Value 'Cant.
Range("K" & LastRow + 1).Value = TextBox5.Value 'Pagina #
'
TextBox1 = "": TextBox2 = "": TextBox3 = "": TextBox4 = "": TextBox5 = "": TextBox6 = "": _
TextBox7 = "": TextBox8 = "": TextBox9 = "": TextBox10 = "": TextBox11 = "": TextBox12 = ""
End SubMi idea no es que de la propiedad al TextBox, Length 125, NO y si en la mism macro.
Como dije y repito, AUNQUE SE ESCRIBAN en la caja TextBox 55555 caracteres solo entren en la celda D46 125
1 Respuesta
Respuesta de Dante Amor
2

