Ver Mensaje Individual
  #1 (permalink)  
Antiguo 24/06/2008, 15:49
alejosro
 
Fecha de Ingreso: junio-2008
Mensajes: 4
Antigüedad: 15 años, 11 meses
Puntos: 0
Ayuda macro excel !!plss

Hola, necesito una yauda para hacer una macro, me seleccione un dato en la columna “a” hasta a1000 y me la busque en todo un libro, después me devuelva la posición de donde se encuentra en el libro
Yo tengo algo asi :
Dim Hojas
Dim Celda As Range


Sub Busqueda()

i = 1
k = 1

For Each Hojas In ThisWorkbook.Worksheets

On Error GoTo inicio

Hojas.Activate

Set Celda = Hojas.Range("A1")


For j = 1 To 500 '65536 es el maximo
For k = 1 To 40 '256 es el maximo



If Celda.Cells(j, k).Value = m Then
'//
Celda.Cells(j, k).Select
Range("Hoja1!A1").Cells(i, 1).Value = "<=>" & Celda.Cells(j, k).Value & Celda.Cells(j, k).AddressLocal(RowAbsolute:=False, ColumnAbsolute:=False)
Range("Hoja1!B1").Cells(i, 1).Value = Celda.Cells(j, k).Offset(0, 1).Value
i = i + 1
k = k + 1
'------------------------------------------

End If

Next k
Next j

inicio:
If Err Then
Err.Clear

End If
Next Hojas
End Sub