I am trying to write a loop that will look for a specific value "Fund" on one sheet, copy the following range, find that value on another sheet and then paste it in adjacent to it. I keep getting syntax errors such as object required and subscript out of range. Can someone please help?
Thanks in advance!
Dim wkb As Workbook
Dim b As Long
Dim c As Long
Dim LCellP As Long
Dim LCellCopy As Long
Set wkb = Application.ActiveWorkbook
Set IandC = wkb.Sheets("Instructions and CrossRef")
Set Comparison = wkb.Sheets("Comparison")
Set Previous = wkb.Sheets("Previous")
'Move Previous Flows to Comparison Sheet
With Comparison
LCellCopy = Cells(Rows.Count, "A").End(xlUp).Row
End With
Cells(1, 4) = "Good"
Cells(1, 5) = "Not on Previous"
For b = 1 To LCellP
v = Cells(b, 1).Value
If Left(v, 4) = "Fund" Then
For c = 1 To LCellCopy
u = Comparison.Cells(c, 1).Value
If u = Cells(b, 1).Value Then
Comparision.Range(Cells(c, 4), Cells(c + 15, 5)) = Previous.Range(Cells(b, 1), Cells(b + 15, 2)).Value
End If
Next c
End If
Next b