hi how can i modify the code to search in column (C )And put the result in an column (L)
VBA Code:
Sub test()
Dim lr As Long, rng As Range, StartRow As Long, EndRow As Long, StartVal, c
lr = Cells(Rows.Count, 1).End(xlUp).Row
Set rng = Range(Cells(1, 1), Cells(lr, 1))
Set c = Columns(1).Find("yes", after:=Cells(lr, 1), LookIn:=xlValues, LookAt:=xlWhole)
If Not c Is Nothing Then
firstAddress = c.Address
Do
StartRow = c.Row
StartVal = c.Offset(0, 5).Value
Set c = rng.FindNext(c)
EndRow = IIf(c.Row > StartRow, c.Row, lr)
Range(Cells(StartRow - 0, 12), Cells(EndRow - 0, 12)) = StartVal
Loop While Not c Is Nothing And c.Address <> firstAddress
End If
End Sub