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.

Textbox sin caracteres repetidos

publicado

Alguien me podría apoyar con el código para que en un textbox de un userform no se repitan caracteres repetidos.

 

Ejemplo si al empezar a escirbrir la primer letra es una L al escribir la segunda ya no me permita usar dicha letra, y al escribir la tercera me impida usar las dos anteriores

Cabe mencionar que solo serán máximo 3 caracteres los que se usaran en el textbox.

 

De antemano gracias 

Featured Replies

publicado

Suponiendo que tu textbox se llame TextBox1

Private Sub TextBox1_Change()
With TextBox1
   If Len(.Value) > 1 Then
      For x = 1 To Len(.Value) - 1
         If Mid(.Value, x, 1) = Right(.Value, 1) Then
            .Value = Left(.Value, Len(.Value) - 1)
            Exit Sub
         End If
      Next
   End If
End With
End Sub

 

publicado
  • Autor
Hace 8 horas, Antoni dijo:

Suponiendo que tu textbox se llame TextBox1


Private Sub TextBox1_Change()
With TextBox1
   If Len(.Value) > 1 Then
      For x = 1 To Len(.Value) - 1
         If Mid(.Value, x, 1) = Right(.Value, 1) Then
            .Value = Left(.Value, Len(.Value) - 1)
            Exit Sub
         End If
      Next
   End If
End With
End Sub

 

Mil gracias, justo lo que necesitaba 

Duda resuelta

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.