Ayuda macro
Hola expertos necesito ayuda con esta macro
Que busca en todas las hojas un valor
Sub Buscarnombre()
Dim Buscar
Dim texto As String, titulo As String
texto = "Ingrese el numero de Cedula o Nombre y Apellido del Prestatario"
titulo = "Busqueda"
Buscar = InputBox(texto, titulo)
If Buscar = "" Then Exit Sub
For Each hoja In Sheets
If hoja.Name <> "Hoja1" Then
With hoja.Range("A2:AA65500")
Set esta = .Find(Buscar)
If Not esta Is Nothing Then
primeracelda = esta.Address
'opcional: mostrar el nbre de la hoja según consulta original.
hoja.Activate
MsgBox hoja.Name
End If
End With
End If
Next hoja
End Sub
Lo que en si necesito es que esta macro me busque pero en 2 celdas en especifico que serian B6 y B7.
Que busca en todas las hojas un valor
Sub Buscarnombre()
Dim Buscar
Dim texto As String, titulo As String
texto = "Ingrese el numero de Cedula o Nombre y Apellido del Prestatario"
titulo = "Busqueda"
Buscar = InputBox(texto, titulo)
If Buscar = "" Then Exit Sub
For Each hoja In Sheets
If hoja.Name <> "Hoja1" Then
With hoja.Range("A2:AA65500")
Set esta = .Find(Buscar)
If Not esta Is Nothing Then
primeracelda = esta.Address
'opcional: mostrar el nbre de la hoja según consulta original.
hoja.Activate
MsgBox hoja.Name
End If
End With
End If
Next hoja
End Sub
Lo que en si necesito es que esta macro me busque pero en 2 celdas en especifico que serian B6 y B7.
1 respuesta
Respuesta de Elsa Matilde
1
