indupriya9
Programmer
I have the following code which finds one occurence of a value. But what I need to be able to do is to find all occurences of a particular value.
Can anyone help me to modify the above code to find all instances of the value?
Thanks is advance
ip
Code:
Do While Len(Trim(activecell.value)) <> 0
oElective = activecell.value
Worksheets("Trainee Summary").Select
lrow = activecell.SpecialCells(xlLastCell).Row
Set fc = Worksheets("Trainee Summary").Columns("D").Find(oElective)
fc.Select
Do While activecell.value <> oElective And activecell.Row <= lrow
Set fc = Worksheets("Trainee Summary").Columns("D").FindNext(fc)
fc.Select
Loop
activecell.Offset(0, -1).value = "X"
activecell.Offset(0, -1).Font.FontStyle = "Bold"
activecell.Offset(0, 4).value = activecell.Offset(0, 3)
activecell.Offset(0, 4).Font.ColorIndex = 3
ActiveSheet.Calculate
Worksheets("TraineeUnits").Select
activecell.Offset(2, 0).Select
Loop
Can anyone help me to modify the above code to find all instances of the value?
Thanks is advance
ip