Saltar al contenido
View in the app

A better way to browse. Learn more.

Ayuda Excel

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

formato alfanumerico en combobox

publicado

perdonen la molestia expertos queria pedirles un favor porque no logro darle formtato a un combobox y quiero pedirles su ayuda, tengo un combobox al cual quiero meterle el siguiente formato:

34-07-14-009922-X

los primeros digitos son numeros

el ultimo tiene que ser una letra

no importa si no tienen los guiones pero si se los ponen mejor

el ultimo digito debe estar precedido por un guion

de antemano les doy las gracias

cualquier duda estoy a la orden. Saludos

Featured Replies

publicado
  • Autor

lo que pasa es que entiendo como hacerlo por eso solicito la ayuda de ustedes

publicado
  • Autor

El dicho que dice "ayudamé que yo te ayudaré" no aplica aqui solo dejo el codigo por si a alguien que tenga el mismo problema que yo lo llega a necesitar. No me sirvió el buscador Armando Montes lo tuve que hacer yo con mi bajo nivel de programación, aun asi te agradesco la atencion.

Private Sub TextBox1_Change(): On Error Resume Next
Dim NCaracter

TextBox1.Text = UCase(TextBox1.Text)

NCaracter = Len(TextBox1.Value)

Select Case NCaracter

Case 1

If Not IsNumeric(Right(TextBox1, 1)) And Len(TextBox1) > 1 Then
'controlamos que se permita poner decimales
If Right(TextBox1, 1) = "." Or Right(TextBox1, 1) = "," Then
'controlamos que no haya más de 1 signo de puntuación
If InStr(TextBox1, ".") >= 1 And InStr(TextBox1, ",") >= 1 Then TextBox1 = Left(TextBox1, Len(TextBox1) - 1)
If Len(TextBox1) - Len(Replace(TextBox1, ".", "")) >= 2 Then TextBox1 = Left(TextBox1, Len(TextBox1) - 1)
If Len(TextBox1) - Len(Replace(TextBox1, ",", "")) >= 2 Then TextBox1 = Left(TextBox1, Len(TextBox1) - 1)
Else
TextBox1 = Left(TextBox1, Len(TextBox1) - 1)
End If
ElseIf Not IsNumeric(Right(TextBox1, 1)) And Len(TextBox1) = 1 Then
TextBox1 = ""
End If


Case 2
TextBox1 = TextBox1 & "-"

Case 4
If Not IsNumeric(Right(TextBox1, 1)) And Len(TextBox1) > 1 Then
'controlamos que se permita poner decimales
If Right(TextBox1, 1) = "." Or Right(TextBox1, 1) = "," Then
'controlamos que no haya más de 1 signo de puntuación
If InStr(TextBox1, ".") >= 1 And InStr(TextBox1, ",") >= 1 Then TextBox1 = Left(TextBox1, Len(TextBox1) - 1)
If Len(TextBox1) - Len(Replace(TextBox1, ".", "")) >= 2 Then TextBox1 = Left(TextBox1, Len(TextBox1) - 1)
If Len(TextBox1) - Len(Replace(TextBox1, ",", "")) >= 2 Then TextBox1 = Left(TextBox1, Len(TextBox1) - 1)
Else
TextBox1 = Left(TextBox1, Len(TextBox1) - 1)
End If
ElseIf Not IsNumeric(Right(TextBox1, 1)) And Len(TextBox1) = 1 Then
TextBox1 = ""
End If

Case 5
TextBox1 = TextBox1 & "-"

Case 7
If Not IsNumeric(Right(TextBox1, 1)) And Len(TextBox1) > 1 Then
'controlamos que se permita poner decimales
If Right(TextBox1, 1) = "." Or Right(TextBox1, 1) = "," Then
'controlamos que no haya más de 1 signo de puntuación
If InStr(TextBox1, ".") >= 1 And InStr(TextBox1, ",") >= 1 Then TextBox1 = Left(TextBox1, Len(TextBox1) - 1)
If Len(TextBox1) - Len(Replace(TextBox1, ".", "")) >= 2 Then TextBox1 = Left(TextBox1, Len(TextBox1) - 1)
If Len(TextBox1) - Len(Replace(TextBox1, ",", "")) >= 2 Then TextBox1 = Left(TextBox1, Len(TextBox1) - 1)
Else
TextBox1 = Left(TextBox1, Len(TextBox1) - 1)
End If
ElseIf Not IsNumeric(Right(TextBox1, 1)) And Len(TextBox1) = 1 Then
TextBox1 = ""
End If

Case 8
TextBox1 = TextBox1 & "-"

Case 10
If Not IsNumeric(Right(TextBox1, 1)) And Len(TextBox1) > 1 Then
'controlamos que se permita poner decimales
If Right(TextBox1, 1) = "." Or Right(TextBox1, 1) = "," Then
'controlamos que no haya más de 1 signo de puntuación
If InStr(TextBox1, ".") >= 1 And InStr(TextBox1, ",") >= 1 Then TextBox1 = Left(TextBox1, Len(TextBox1) - 1)
If Len(TextBox1) - Len(Replace(TextBox1, ".", "")) >= 2 Then TextBox1 = Left(TextBox1, Len(TextBox1) - 1)
If Len(TextBox1) - Len(Replace(TextBox1, ",", "")) >= 2 Then TextBox1 = Left(TextBox1, Len(TextBox1) - 1)
Else
TextBox1 = Left(TextBox1, Len(TextBox1) - 1)
End If
ElseIf Not IsNumeric(Right(TextBox1, 1)) And Len(TextBox1) = 1 Then
TextBox1 = TextBox1
End If

Case 15
TextBox1 = TextBox1 & "-"


Case 17
'If TextBox1.Value Like "[A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z]" = False Then
'MsgBox "El caracter 1 solo puede ser las letras (A,E,I,V,X)"
'TextBox1 = ""
'Else
'TextBox1 = TextBox1 & "-"
'End If

If IsNumeric(Right(TextBox1, 1)) Then TextBox1 = Left(TextBox1, Len(TextBox1) - 1)


End Select

End Sub[/PHP]

Archivado

Este tema está ahora archivado y está cerrado a más respuestas.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.