Mindpsyche
Well-known Member
- Joined
- Mar 19, 2012
- Messages
- 760
Hello,I have been trying to understand how to use the find in vba (ctrl+f). I have read up that it is very versatile and can be used instead of loops in many cases.Anyway, this is the code from the Help:
Code:
With Worksheets(1).Range("a1:a500") Set c = .Find(2, lookin:=xlValues) If Not c Is Nothing Then firstAddress = c.Address Do c.Value = 5 Set c = .FindNext(c) Loop While Not c Is Nothing And c.Address <> firstAddress End IfEnd With[\CODE]The part i dont understand is Loop while Not c is nothing And c.address <> firstaddress Does c.address not change throughout the entire find procedure? i.e. is the c.address the address of the first cell where the value 2 is found?If anyone can throw some light on this, and also if you have any nice links which give a clearer understanding of Find, i would be grateful. (For example: I have seen an example of someone find to lookup the font.bold of a cell, but i can't find the link)...Thanks