As expected, your data layout is different from first post, and your new data layout have so many inconsistencies :
- You add a new column (S/N --> column A), this makes all data is shifted to right, and of course, calculation will be wrong
- Data sometime start from row 2 (Sheet1 - Sheet5), sometime from row 1 (Sheet6 - Sheet20)
- % Attendance column location is always changed, for the last workbook it is located at column Y, for Sample1.xlsx it is at column J, for Sample2.xlsx is at column L
- Sample2.xlsx, this workbook has NO DATA entered yet !!! How can you expect macro run on empty tables ??!!
So :
- STOP keep changing your data layout, if you keep doing this, don't expect the macro will be worked, and don't expect me to remake the macro anytime you rechange the layout
- Don't do something silly like "the macro is not worked" on workbook WITH EMPTY TABLES like Samples2.xlsx, I don't understand what your motive by doing this
This macro will work on Sample1.xlsx, and Sample2.xlsx if Sample2.xlsx has already filled with some data, don't expect this can run if you rechange the data layout again.
Bookmarks