I have started to execute the Sub by F8 and on "8 row of the Sub" the message above is appeared. And this is happend with another Sub, which consists "Range(...)".
My last Sub is:
Sub Voltage() Dim Voltage Dim Difference Dim i As Integer Dim AvrPoints As Boolean AvrPoints = False Dim LastRow As Long LastRow = Range("B65536").End(xlUp).Row Do Until AvrPoints = True For i = 1 To LastRow Voltage = Application.WorksheetFunction.Average(Range("B1:B" & i)) Diference = Cells(i + 1, 2) - Voltage If Difference > 0.0004 Then AvrPoints = True End If Next i Loop MsgBox Voltage End Sub




Reply With Quote