Here's the code giving me trouble ... The line in red... DateArray() subscript giving problems but can't figure it out...

 ReDim DateArray(counter)
    
    With Range(SalesPAddress)
        
        For i = 1 To LastCell
            
            If .Offset(i, 0).Value = "Dewi" Then
            MsgBox "The date value is: " & .Offset(i, -1).Value
                DateArray(i) = .Offset(i, -1).Value                
            End If
            
            TotalSalesOfRep = TotalSalesOfRep + .Offset(i, 1).Value
        Next
        
        MsgBox "The total a salesrep earns is: " & TotalSalesOfRep
        
    End With
Any advice is appreciated. Thanks