In a former life I wrote some Visual Basic, and today I need to resurrect those skills to write an Excel Macro. While trawling the Internet looking for VBA examples to help we with this Excel macro, I came across this unusual syntax:
Set rFound = .Columns(1).Find(What:="Cat", After:=.Cells(1, 1), LookIn:=xlValues, LookAt:= _
xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False _
, SearchFormat:=False)
Notice the .Columns and .Cells--the dot operators have no object names to the left.
I remember using this syntax long ago, but I can't remember the details. I'm having a hard time finding anything helpful on Google or in MSDN.
Questions:
- When is this legal?
- What variable is the dot operator infering?
- Where can I get more information?
Thanks.