Please tell me where i am going wrong. Thank You So Much
Code:
Sub UpdateTotal()
'Update Scores
Application.ScreenUpdating = False
Dim Sh As Worksheet
Dim Lrow As Long
Dim Rng As Range
Dim Lcol As Long
Set Sh = Sheets("Table")
Lrow = Sheets("Result").Range("B" & Rows.Count).End(xlUp).Row
Set Rng = Range("B2:B" & Lrow)
Lcol = Sh.Cells(2, Columns.Count).End(xlToLeft).Column + 1
For Each WS In Worksheets
If WS.Name <> "Table" And WS.Name <> "Result" Then
[COLOR=#ff0000]With Range(Rng)
.Offset(0, 1).Formula = "=IF(AND(B2=Result!B2,D2=Result!D2),3,IF(AND(B2=D2,Result!B2=Result!D2),1,IF(OR(AND(D2>B2,Result!D2>Result!B2),AND(B2>D2,Result!B2>Result!D2)),1,0)))"
.Value = .Value
[/COLOR] End With
End If
Next WS
'Update Summary Sheet
With Sh.Range(Cells(2, Lcol), Cells(27, Lcol))
.Formula = "=INDIRECT(""'""&A2&""'!""&""F""&MATCH(1E+100,Result!F:F))"
.Value = .Value
End With
Application.ScreenUpdating = True
End Sub