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.

Formulario de búsqueda en visual basic no me funciona

publicado

Bueno lo que quiero que haga este mini formulario es sencillo, son 2 cosas que al entrar un registro busque si no se ha capturado antes y si ese "folio" ya se compro, estos folios estas en la hoja 2.

Perdon por no subir el archivo pero es muy cortito el codigo si infrigo la ley del foro mil disculpas.

Private Sub CommandButton1_Click()

Me.TextBox1.Text = ""

Me.TextBox2.Text = ""

End Sub

Private Sub CommandButton2_Click()

Dim foliod As String

Dim ultimafila As Double

Dim Rango As Range

ultimafila = ActiveSheet.UsedRange.Row - 1 + ActiveSheet.UsedRange.Rows.Count

If TextBox1.Text = TextBox2.Text Then

Sheets("Hoja2").Activate

ActiveSheet.Range("A2").Select

If Range("A2:A200").Find(What:=TextBox2.Value _

, After:=ActiveCell, LookIn:=xlValues, LookAt:= _

xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _

False).Activate Then

Sheets("Datos").Activate

If Range("A3:A200").Find(What:=TextBox2.Value _

, After:=ActiveCell, LookIn:=xlValues, LookAt:= _

xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _

False).Activate Then

MsgBox ("El Folio ya esta registrado")

Else

Cells(ultimafila + 1, 1) = TextBox2.Value

End If

Else

MsgBox ("El Folio aun no se ha adquirido")

End If

Else

MsgBox ("Los Folios NO Coinciden")

End If

End Sub

Muchas Gracias por adelantado.

Featured Replies

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.