Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I am creating a simple find loop to find all the "smith" entries in column A.
I copy & pasted this code from Ozgrid and modified slightly. Sub findSmith() Dim lCount As Long Dim rFoundCell As Range Set rFoundCell = Range("A1") For lCount = 1 To WorksheetFunction.CountIf(Columns(1), "smith") Set rFoundCell = Columns(1).Find(What:="smith", After:=rFoundCell, _ LookIn:=xlValues, LookAt:=xlPart, SearchOrder:=xlByRows, _ SearchDirection:=xlNext, MatchCase:=False) rFoundCell.Select MsgBox ("You are here.") Next lCount End Sub However, it only finds the first instance of "smith" in column A and stops. Can anyone shed some light on this? Thank you, JSnow |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
VBA Loop to Find then Copy & Paste | Excel Discussion (Misc queries) | |||
VBA Loop Help | Excel Discussion (Misc queries) | |||
Find & loop in VBA | Excel Discussion (Misc queries) | |||
Find and Copy loop problem | Excel Discussion (Misc queries) | |||
Do Loop | Excel Worksheet Functions |