I met with an error while runing the code
error name - run time error 9 subscript out of range
highlighted line : Set Wb1 = Workbooks("ap.xls") ' Set using workbooks collection object of open files