Object syntax with a Period ( . )
I took the code below from the VBA help example for the
Find Next method, and am in process of learning more
about it and building a general find proc that can be called.
In this line,
Set InfoCell = .Find(IFindThis, LookIn:=xlFormulas)
I remember reading somewhere about the period(.) being
placed before the word Find. Not that I'm looking for that
documentation, I can't find it. (no pun intended)
Can someone point me to the right section and/or give me
a brief explanation of the .Find syntax?
thanks,
Neal Z
Sub zzz_Find_Method(IFindThis)
'This example finds all cells in the range A1:A25 that _
contain the value in the IFindThis var.
Dim InfoCell As Object
Dim FirstAddress
'With Worksheets("2222-0900").Range("a1:a25")
With Worksheets("2222-0900").Range(Cells(1, 1), Cells(25, 1))
Set InfoCell = .Find(IFindThis, LookIn:=xlFormulas)
If Not InfoCell Is Nothing Then
FirstAddress = InfoCell.Address
MsgBox "FirstAddress= " & FirstAddress & Cr _
& "InfoCell.Row= " & InfoCell.Row & " InfoCell.Column= " &
InfoCell.Column
Do
Set InfoCell = .FindNext(InfoCell)
If Not InfoCell Is Nothing And InfoCell.Address < FirstAddress _
Then MsgBox InfoCell.Address
Loop Until Not InfoCell Is Nothing And InfoCell.Address = FirstAddress
Else
MsgBox IFindThis & " is NOT found."
End If
End With
End Sub
--
Neal Z
|