This line calculates that last row you have (for Column B).
[vba]LastRow = ActiveSheet.Range("B65536").End(xlUp).Row [/vba]
Try this macro:
[vba]
Option Explicit

Sub Voltage()

Dim Voltage As Double
Dim Difference As Double
Dim i As Long
Dim AvrPoints As Boolean
Dim LastRow As Long

LastRow = Range("B65536").End(xlUp).Row
For i = 2 To LastRow
Voltage = Application.WorksheetFunction.Average(Range("B1:B" & i))
Difference = Cells(i + 1, 2) - Voltage
If Difference > 0.0004 Then
AvrPoints = True
Exit For
End If
Next i
If AvrPoints = True Then
MsgBox Voltage
Else
MsgBox "Criteria was not met.", vbInformation
End If

End Sub
[/vba]