-
Solved..
[VBA]Sub LargestGPW()
'
Dim lngLastRow As Long, rngData As Range, rngCell As Range
lngLastRow = Cells(Rows.Count, "g").End(xlUp).Row
On Error Resume Next
Set rngData = Range("G26:G" & lngLastRow).SpecialCells(xlCellTypeBlanks)
On Error GoTo 0
If Not rngData Is Nothing Then
For Each rngCell In rngData
With rngCell
.Offset(1, -2).FormulaR1C1 = "=LOOKUP(2,1/((R27C7:R" & lngLastRow & "C7=RC[2])*(R27C29:R" & _
lngLastRow & "C29=R[1]C[1])),R27C11:R" & lngLastRow & "C11)"
.Offset(2, -1).FormulaArray = "=MAX(IF(R27C7:R" & lngLastRow & "C7=RC[1],R27C29:R" & lngLastRow & "C29))"
End With
Next rngCell
End If
End Sub[/VBA]
Here is the code 4 da benefit of others.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules