I tested it, it works fine if you drop "myWB." from in front ofthe "Application.WorksheetFunction..." statement. (Also if you have setOption Explicit don't forget to declare txtTot as string.)