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.

Combobox sin registros duplicados en Excel VBA

publicado

Tengo un combobox1 que se carga al iniciar el libroprueba.xlsm, este combobox1 al elegir un dato a  su vez me carga otro combobox2 con esta instrucción:

 

Private Sub Combobox1_Change()

Dim i As Integer

Dim libro As Workbook

Combobox2.Clear

Set libro = Workbooks.Open("libroprueba.xlsm")
With libro.Sheets("hoja1")


For i = 2 To .Range("P" & Rows.Count).End(xlUp).Row
If .Cells(i, 2).Value = combobox1.Value Then
combobox2.AddItem .Cells(i, 16).Value
End If
'Next i

End With

libro.close

End Sub

 

Mi problema es que el combobox2 me esta cargando con registros repetidos...¿Como puedo modificar esta macro para que no se repitan dichos registros? Muchas gracias por la ayuda...

Featured Replies

publicado
  • Autor

Hola @tierra_pampa

Mil gracias por responder, al parecer "cacharreando" como se dice popularmente en Colombia :D pude solucionarlo, te agradezco nuevamente...Saludos

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.