Below is an attempt at a code that if the value in F2 is... then it does a vlookup in a shett named panel in a select range (G and H). Can someone please help me with the syntax? Thank you.
' Step 3 Add Inheritance
i = Range("F" & Rows.Count).End(xlUp).Row
For Each rngCell In Range("F2" & i)
With ActiveSheet
With .Range("C5:C" & lastrow)
Select Case rngCell.Value
Case Is = "Comprensive Epilepsy"
With rngCell.Offset(0, 6)
.Formula = "=Index(Panel!H1:H70, Match(B5,panel!G1:G70,0))"
End With
i = Range("F" & Rows.Count).End(xlUp).Row
Select Case rngCell.Value
Case Is = "Marfan Disorder"
With rngCell.Offset(0, 6)
.Formula = "=Index(Panel!H25609:H25628, Match(B5,panel!G25609:G25628,0))"
End With
End Select
End With
Bookmarks