Hi,
Why formulas in vba are not as simple in cells
I have a syntax error but why , andtried with double or single quotes. No change.
Sub TEST99()
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
If ws.Name <> "Master" Then
lastRow = ws.Range("AT2" & Rows.Count).End(xlUp).Row
ws.Range("AV2").Formula = ""=SUMPRODUCT(1/COUNTIF(("AT2:AT" & lastRow),("AT2:AT" & lastRow)))""
End If
Next ws
End Sub
Thank you ?
Why formulas in vba are not as simple in cells
I have a syntax error but why , andtried with double or single quotes. No change.
Sub TEST99()
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
If ws.Name <> "Master" Then
lastRow = ws.Range("AT2" & Rows.Count).End(xlUp).Row
ws.Range("AV2").Formula = ""=SUMPRODUCT(1/COUNTIF(("AT2:AT" & lastRow),("AT2:AT" & lastRow)))""
End If
Next ws
End Sub
Thank you ?