martes, 23 de agosto de 2016

Búsqueda de datos

Buscar un valor 
 
zona=Range("A:A") 
Set c = zona.Find("CASA", lookin:=xlValues) 
If Not c Is Nothing Then 
   inicio= c.Address 
   Do 
      c.Value = "HOGAR"
      Set c = zona.FindNext(c) 
   Loop While Not c Is Nothing And c.Address <> inicio
End If
 
Última celda con datos:
Set ultima = Cells(Cells.Find(What:="*", SearchOrder:=xlRows, _
      SearchDirection:=xlPrevious, LookIn:=xlValues).Row, _
      Cells.Find(What:="*", SearchOrder:=xlByColumns, _
      SearchDirection:=xlPrevious, LookIn:=xlValues).Column) 


Primera celda con datos
Set primera= Cells(Cells.Find(What:="*", After:=LastCell, SearchOrder:=xlRows, _
      SearchDirection:=xlNext, LookIn:=xlValues).Row, _
      Cells.Find(What:="*", After:=LastCell, SearchOrder:=xlByColumns, _
      SearchDirection:=xlNext, LookIn:=xlValues).Column)

No hay comentarios: