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.

Copiar datos de un listbox a otro con doble click

publicado

Buenas tardes, tengo este codigo para pasar un dato seleccionado de Listbox1 a listbox2 que funciona perfecto. Lo unico que no pude resolver es que me copie todas las columnas.

Private Sub listbox1_DblClick(ByVal Cancel As MSForms.ReturnBoolean)

If Listbox1.ListCount = 0 Then Exit Sub

Listbox2.AddItem (Listbox1)

End Sub

Probe con esto

Private Sub listbox1_DblClick(ByVal Cancel As MSForms.ReturnBoolean)

If Listbox1.ListCount = 0 Then Exit Sub

Listbox2.AddItem (Listbox1)

i = Listbox2.ListCount - 1

For j = 1 To 5

Listbox2.List(i, j) = Listbox1.List(ListBox1.ListIndex, j)

Next j

End Sub

Pero me dice "No se puede configurar la propiedad List. Los tipos no coinciden", alguna sugerencia?

Muchas gracias desde ya

Featured Replies

publicado

Hola:


Private Sub ListBox1_DblClick(ByVal Cancel As MSForms.ReturnBoolean)

ListBox2.AddItem
For y = 0 To ListBox1.ColumnCount - 1
ListBox2.List(ListBox2.ListCount - 1, y) = ListBox1.List(ListBox1.ListIndex, y)
Next

End Sub
[/CODE]

Llevas ya 9 temas y sigues incumpliendo las normas del foro.

La próxima vez que no subas un archivo para pruebas o que no englobes el código VBA en su correspondiente etiqueta, tu consulta será cerrada sin previo aviso.

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.