i have the following code:
.AutoFilter Field:=3, Criteria1:=docnum
    .AutoFilter Field:=6, Criteria1:=pmtdate
  
    Range("H1").Select
    Selection.Offset(1, 0).Select
     Range(Selection, Selection.End(xlDown)).Select
     visibleTotal = Application.WorksheetFunction.Sum(Selection.SpecialCells(xlCellTypeVisible))
     
     
     
     If visibleTotal = pmtamt Then
     
     MsgBox visibleTotal
so, my issue is i want it to accept the visible total with a range of (up to +-10) .
for example if my variable is = 10 i want my code to match everything from 0 to 20 with a margin of + or - 10 numbers from my variable
so everything between 0 and 20 should be matched including 10.001 and 10.569... ETC..
i'm doing this to match amounts regardless of currency differences that might raise the amount or decrease it and my allowed range is + or - 10 $
let me know if my question isn't clear.
 
    