I have the following VBA code that i want which is to count the number of used rows and then find the number of empty cells in Column B, it's returning a syntax error
Sub Logic()
'Count Number of used Rows
LastRow = Worksheets("TASK").UsedRange.Rows.count
Range("O3") = LastRow
'Count Number of Empty cells within the used Row
Dim EmptyCell As Integer
EmptyCell = Application.WorksheetFunction.CountIf(Range("B1":"B" & LastRow), "")
Range("O4") = EmptyCell
End Sub
Thanks for helping