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.

Buscar en un formulario

publicado

Buenos Dias

Por favor me pueden ayudar ya que tengo el siguiente codigo para buscar pero me sale error, por favor su apoyo.

Dim ult As Integer
Dim datoBusqueda As String
Dim ncontrato As Long


ult = transRowRng.Rows.Count

datoBusqueda = TextBox1.Text

If datoBusqueda = "" Then
    MsgBox "Búsqueda cancelada", vbInformation, "Mensaje"
    Exit Sub
Else
    ncontrato = Val(datoBusqueda)
    For j = 1 To ult
        If Cells(j, 2) = ncontrato Then
            cont = 1
            fila = j
                TextBox2.Text = Cells(j, 3)
End If
    Next j
End If
If cont = 0 Then
    MsgBox "Contrato no encontrado", vbInformation, "Resultado"
End If
 

Gracias

BUSCAR.xlsm

Featured Replies

publicado
  • Autor

Buenas Tardes Toldeman, lo probe y me sigue saliendo error, por favor me podrías ayudar con otra alternativa.

Muchas Gracias por tu apoyo.

publicado

Prueba con...

Private Sub CMBBUSCAR_Click()
Dim ult As Integer
Dim datoBusqueda As String
Dim ncontrato As Long
    ult = Range("A2:A" & Rows.Count).End(xlDown).Row
    datoBusqueda = TextBox1.Text
    If datoBusqueda = "" Then
        MsgBox "Búsqueda cancelada", vbInformation, "Mensaje"
        Exit Sub
    Else
        ncontrato = Val(datoBusqueda)
        For j = 1 To ult
            If Cells(j, 1) = ncontrato Then
                cont = 1
                fila = j
                TextBox2.Text = Cells(j, 3)
            End If
        Next j
    End If
    If cont = 0 Then
        MsgBox "Contrato no encontrado", vbInformation, "Resultado"
    End If
End Sub

Saludos

publicado
  • Autor

oK, listo, el problema que no me salia es porque yo estaba poniendo

Cells(j, 2)

y debio ser 

 

Cells(j, 1)

 

Muchas Gracias.

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.