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.

abrir userform con item del combobox

publicado

hola amigos espero se encuentren bien, miren tengo una duda con un codigo que tengo, lo que pasa es que tengo un combobox que al escribir el nombre me abre el userform2 el problema que tengo es que si tengo dos nombres iguales pero con apellidos diferentes cuando tecleo por ejemplo carlos me abre automaticamente el userform2, lo que quiero es que hasta que ponga el nombre completo con apellido me abra el userform2, pero no se que estoy haciendo mal.

espero me puedan ayudar

gracias :calm:

Private Sub UserForm_Initialize()

Dim celda

Dim X

For Each celda In Sheets("Clientes").Range("A2:A" & Sheets("Clientes").Range("A" & Rows.Count).End(xlUp).Row)

X = WorksheetFunction.CountIf(Sheets("Clientes").Range("A2:A" & celda.Row), celda)

If X = True Then

ComboBox1.AddItem celda

End If

Next celda

End Sub

Private Sub ComboBox1_Change()

Dim myrange As Range

Dim X

X = ComboBox1

Set myrange = Sheets("DatosGuardados").Range("A:A")

If WorksheetFunction.CountIfs(myrange, ComboBox1) <> 0 Then

Load UserForm2

UserForm2.Show

ComboBox1.Tag = X

End If

End Sub

Featured Replies

publicado

También podrías usar el evento KeyDown del ComboBox1 en lugar del evento Change para que ejecute el código que quieres hasta que presiones alguna tecla, por ejemplo hasta que presiones Enter:

Private Sub ComboBox1_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)

If KeyCode = 13 Then

'aquí el código que deseas ejecutar

End If

End Sub

publicado
  • Autor

Hola muchas gracias por tu ayuda me funciono perfecto te lo agradezco mucho :victorious:

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.