Hey all! Is it possible to use ACTIVECELL.OFFSET combined with the Application.WorksheetFunction INDEX/MATCH formula? I tried R1C1 without success and I can't refer to the cell explicitly, as I'd like to loop through a range and apply the formula if the conditions are met. So far, here's what I've got...
I'm getting the subscript out of range error right now, but was also getting an object error earlier that I'm confident still needs addressed as well. Thoughts?
Thanks in advance!!
Code:
Sub InchstoneFormula()
Dim i As Range
For Each i In Sheet4.Range("E4:E5")
If i.Offset(0, -2) <> "" Or i.Offset(0, 3) <> "" Then
i.Formula = Application.WorksheetFunction.Index(Sheets("Inchstone").Range("E4:E504"), Application.WorksheetFunction.Match((i.Offset(0, -2)), Sheets("Inchstone").Range("G4:G504"), 0) + (i.Offset(0, -1)))
End If
Next i
End Sub
I'm getting the subscript out of range error right now, but was also getting an object error earlier that I'm confident still needs addressed as well. Thoughts?
Thanks in advance!!