1 Attachment(s)
Solved: Enter Formula on Multiple Locations using Macros
Hi Guys,
I have the following
[VBA]Sub LargestGPW()
'
Range("E27").Select
Selection.FormulaArray = _
"=LOOKUP(2,1/((R27C7:R200C7=RC[2])*(R27C29:R200C29=RC[1])),R27C11:R200C11)"
Range("F28").Select
Selection.FormulaArray = "=MAX(IF(R27C7:R200C7=RC[1],R27C29:R200C29))"
Range("E27").Select
End Sub[/VBA]
which gives me a location name along with that locations maximum value.
The formula looks for a condition met from column G, matches it to column AC and then gives me the result from column K , here is the formula
{=LOOKUP(2,1/(($G$27:$G$200=G27)*($AC$27:$AC$200=F27)),$K$27:$K$200)}.
What i need is to be able to insert that same formula by first looking down column G next available empty row and once it finds it insert the formula on column E and F one row below where the empty row is first found from column G.
Sounds:bug: ,I can manually enter formula then copy paste in the proper row and column but the problem I have others will be using this worksheet and I wanted to this automated.
Thanks...