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.

Traer información de ListBox

publicado

Hola Ojala alguien ojala pueda ayudarme y de antemano agradezco la ayuda para detectar donde esta el error en mi Macro

estoy creando una base de datos y en un Form  trae la información a un ListBox , hasta acá todo bien pero  quiero que al dar Clic en alguna linea de la información del listbox me traiga un valor a aun texbox y esto es lo que no logro 

estoy usando WorksheetFunction.VLookup pero por más que veo no hace nada al hacer clic en el listBox

 

Private Sub ListBox1_Click()

   On Error GoTo ErrorHandler

cuenta = FormNuevoProducto.ListBox1.ListCount

    For i = 0 To cuenta - 1
    
        If FormNuevoProducto.ListBox1.Selected(i) = True Then
            cuenta = FormNuevoProducto.ListBox1.List(i)
        End If
    Next i
        FormNuevoProducto.TextBox1 = Application.WorksheetFunction.VLookup(cuenta, Sheets("CATALOGOMP").Range("CatalogoMP"), 5, 0)
        
        
        Dim nEditarRegistro As Integer
    
ErrorHandler:
If Err.Number = 1004 Then
    With Me

    End With
End If
            
End Sub

 

 

 

Function nEditarRegistro(nombre As String) As Integer
Application.ScreenUpdating = False

    
    Sheets("CATALOGOMP").Activate
    
    Range("A2").Activate
    
    
    nEditarRegistro = 0
    
    Do While Not IsEmpty(ActiveCell)
        If nombre = ActiveCell Then
            nEditarRegistro = ActiveCell.Row
        End If
        ActiveCell.Offset(0, 0).Select
    Loop
    
Application.ScreenUpdating = True
End Function

 

 

Featured Replies

publicado

Buenos días, lo que entendi

  FormNuevoProducto.TextBox1 = ListBox1.Text ' texto de la 1 columna
  FormNuevoProducto.TextBox2 = ListBox1.List(ListBox1.ListIndex, 1) ' texto de la 2 columna

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.