the purpose of my macro is to find a certain value "MI (D)" within column B then execute code based on the surrounding cells. Sometimes there's only one value, sometimes there can be more. How can I code my for loop so it starts with the first one, then checks the column for more? Right now my code does the first one perfectly, but if there is a second, third one, etc it doesn't execute.
Dim Rng As Range
Dim cell As Variant
Dim ws As Worksheet
Set ws = ActiveSheet
Set Rng = Range("B:B").Find("MI (D)")
For Each cell In Rng
If Not Rng Is Nothing Then
Rng.Select
End If
ActiveCell.Offset(0, 1).Select
Range(ActiveCell, ActiveCell.Offset(0, 1)).Select
Selection.Copy
'For Each cell In ws.Columns(3).Cells
' If IsEmpty(cell) = True Then cell.Select: Exit For
'Next cell
Dim LastRow As Long
LastRow = Cells(Rows.Count, 1).End(xlUp).Row
Cells(LastRow, 3).Offset(1, 0).Select
Selection.PasteSpecial paste:=xlPasteValues
ActiveCell.Offset(1, 0).Select
Selection.PasteSpecial paste:=xlPasteValues
ActiveCell.Offset(1, 0).Select
Selection.PasteSpecial paste:=xlPasteValues
ActiveCell.Offset(1, 0).Select
Selection.PasteSpecial paste:=xlPasteValues
ActiveCell.Offset(-3, 0).Select
ActiveCell = ActiveCell - 1
ActiveCell.Offset(0, 1).Select
ActiveCell = ActiveCell + 25
ActiveCell.Offset(1, -1).Select
ActiveCell = ActiveCell - 1
ActiveCell.Offset(0, 1).Select
ActiveCell = ActiveCell + 25
ActiveCell.Offset(1, -1).Select
ActiveCell = ActiveCell - 11
ActiveCell.Offset(0, 1).Select
ActiveCell = ActiveCell + 50
ActiveCell.Offset(1, -1).Select
ActiveCell = ActiveCell - 11
ActiveCell.Offset(0, 1).Select
ActiveCell = ActiveCell + 50
Rng.Select
ActiveCell.Offset(0, -1).Select
Selection.Copy
'For Each cell In ws.Columns(1).Cells
' If IsEmpty(cell) = True Then cell.Select: Exit For
'Next cell
LastRow = Cells(Rows.Count, 1).End(xlUp).Row
Cells(LastRow, 1).Offset(1, 0).Select
Selection.PasteSpecial paste:=xlPasteValues
ActiveCell.Offset(1, 1).Select
Selection.PasteSpecial paste:=xlPasteValues
ActiveCell.Offset(1, -1).Select
Selection.PasteSpecial paste:=xlPasteValues
ActiveCell.Offset(1, 1).Select
Selection.PasteSpecial paste:=xlPasteValues
ActiveCell.Offset(-3, 0).Select
Selection = "ON (D)"
Selection.Copy
ActiveCell.Offset(1, -1).Select
Selection.PasteSpecial paste:=xlPasteValues
ActiveCell.Offset(1, 1).Select
Selection = "ON (I)"
Selection.Copy
ActiveCell.Offset(1, -1).Select
Selection.PasteSpecial paste:=xlPasteValues
Next cell
End sub```
[![enter image description here][1]][1]
[1]: https://i.stack.imgur.com/ltM8S.png