I have a sheet which has a specific text occurring once in a range. I want to identify that cell with the text in column A and insert a formula
My excel sheet has a text called "Weighted" in Column A. This is between the range A152:A200. I want to identify this word in the range and write a formula in column I. Assuming this word is in A162, the formula in corresponding I162 should be I152(This is always the same):I161 (Always one row ahead of the word weighted)
If the word weighted occurs in A160, the formula in I160 should be sum(I152:I159). Any ideas how this can be done. I have tried the below code but am unable to proceed
Dim ws As Worksheet, sCellVal As String
Dim Q As Range
Set ws = ActiveSheet
For Each Q In Range("A152:A200")
sCellVal = Q.Text
If sCellVal Like "*Weighted:*" Then Offset(8,0)