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.

Busqueda con repeticiones

publicado

buenas tardes necesito una ayuda con una macro para buscar datos en una base de datos pero cuando el código buscado se repite solo me extrae los datos del primero necesito ayuda que cuando se repita me emita algún listado de cuales son los q se repiten y cual deseo usar

la macro es la siguiente:

Sub Buscar()

Application.ScreenUpdating = False

Application.Calculation = xlCalculationManual

Application.EnableEvents = False

ActiveSheet.DisplayPageBreaks = False

Sheets("BUSCAR").Unprotect ("17919119")

Dim WS As Worksheet

Dim rBingo As Range

Borrar_Form

For Each WS In ThisWorkbook.Worksheets

If WS.Name Like "Dir*" Then

Set rBingo = WS.Cells.Find(What:=[Codigo], LookAt:=xlWhole)

If Not rBingo Is Nothing Then Exit For

End If

Next WS

If rBingo Is Nothing Then

' No encontrado

MsgBox "Código " & [Codigo] & " no encontrado", vbInformation, "AM Consultores"

Else

Copiar_datos WS, rBingo.Row

Application.ScreenUpdating = True

Application.Calculation = xlCalculationAutomatic

Application.EnableEvents = True

ActiveSheet.DisplayPageBreaks = True

Application.CutCopyMode = False

End If

End Sub

Featured Replies

publicado
buenas tardes necesito una ayuda con una macro para buscar datos en una base de datos pero cuando el código buscado se repite solo me extrae los datos del primero necesito ayuda que cuando se repita me emita algún listado de cuales son los q se repiten y cual deseo usar

la macro es la siguiente:

Sub Buscar()

Application.ScreenUpdating = False

Application.Calculation = xlCalculationManual

Application.EnableEvents = False

ActiveSheet.DisplayPageBreaks = False

Sheets("BUSCAR").Unprotect ("17919119")

Dim WS As Worksheet

Dim rBingo As Range

Borrar_Form

For Each WS In ThisWorkbook.Worksheets

If WS.Name Like "Dir*" Then

Set rBingo = WS.Cells.Find(What:=[Codigo], LookAt:=xlWhole)

If Not rBingo Is Nothing Then Exit For

End If

Next WS

If rBingo Is Nothing Then

' No encontrado

MsgBox "Código " & [Codigo] & " no encontrado", vbInformation, "AM Consultores"

Else

Copiar_datos WS, rBingo.Row

Application.ScreenUpdating = True

Application.Calculation = xlCalculationAutomatic

Application.EnableEvents = True

ActiveSheet.DisplayPageBreaks = True

Application.CutCopyMode = False

End If

End Sub

@[uSER=173994]yordin[/uSER]

Porfavor debes entender a cabalidad las normas del foro, como tambien debes envolver con etiquetas los codigos o formulas, por ejemplo este

Sub Buscar()
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
Application.EnableEvents = False
ActiveSheet.DisplayPageBreaks = False
Sheets("BUSCAR").Unprotect ("17919119")
Dim WS As Worksheet
Dim rBingo As Range
Borrar_Form
For Each WS In ThisWorkbook.Worksheets
If WS.Name Like "Dir*" Then
Set rBingo = WS.Cells.Find(What:=[Codigo], LookAt:=xlWhole)
If Not rBingo Is Nothing Then Exit For
End If
Next WS
If rBingo Is Nothing Then
' No encontrado
MsgBox "Código " & [Codigo] & " no encontrado", vbInformation, "AM Consultores"
Else
Copiar_datos WS, rBingo.Row
Application.ScreenUpdating = True
Application.Calculation = xlCalculationAutomatic
Application.EnableEvents = True
ActiveSheet.DisplayPageBreaks = True
Application.CutCopyMode = False
End If
End Sub[/CODE]

Desde ya tienes que entender que no solo es cuestion de publicar un tema para preguntar como sea, en este tema te hace falta algo muy importante

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.