Hi Kris, Takes a little more time/energy to debug when not familiar with the code and data, but see if this helps.. if not I can look at it further:
The code to create the Result sheet never executes because n = 0 at that point n = 0 because the value of n was never set in executed code thus far n was never set because iFlg was never set to True iFlg was never set to True because Cnt was never = 2 The first time the Cnt = Application.CountA(FC) line executes Cnt is set to 17. (FC(1)="Fruit", FC(2) to FC(17)=Empty) The second time, Cnt is set to 17 again. (FC(1)="HOLPI", FC(2)="HOLISTIC PINEAPPLE", the rest Empty) The third time, Cnt is 17, FC(1)=1214, FC(2)="YELLOW, FLESH, (3)(4)(5)=Empty, (6)="YELLO", (7)=Empty, Etc. CountA is not documented in Excel 2010 as a method of Application, just of Application.WorksheetFunction. (Same goes for .Index) Changing Application.CountA to Application.WorksheetFunction.CountA made no difference. You declared ka and fc as Variants, and Excel used them as Variant Arrays of Variants. Perhaps CountA is no longer compatible with arrays?? Declaring both ka and fc as ranges, as making the couple of necessary changes thereof (use Set to set, replacing ubound() with .rows.count and .columns.count), and your routine appears to work as far as creating a one line report: Summary of Monthly Fruit Sales Waynes Fruit Store Date Run : Month Ending Date Code Fruit Number Fruit Fruit Code Register Digit Code Current Extra. Total Month Extra Total Year Extra Total 1/10/1998 6:36 06214 - 10/01/1998 ERAPP ERICS APPLES 6624 GRANNY SMITH, RED GRANN 12865475 0 0 0 0 0 0 106.45 0 106.45 Possibly it was only necessary to do this with fc (if you were strategically using arrays due to a performance gain or some other reason.) I have to stop now, but I may have made a mistake in implementation of the change to ranges, and in any case maybe the remaining changes required for a full report will be clearer to you now. Asa From: excel-macros@googlegroups.com [mailto:excel-macros@googlegroups.com] On Behalf Of Kris Sent: Wednesday, January 04, 2012 8:22 AM To: excel-macros@googlegroups.com Subject: Re: $$Excel-Macros$$ Test XL 2007 code on XL 2010 Hi Guys, Thanks for testing the code. Can you please debug the code ? I want to know which command/keyword likes XL 2007 but not XL 2010. Thanks Kris -- FORUM RULES (986+ members already BANNED for violation) 1) Use concise, accurate thread titles. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get quick attention or may not be answered. 2) Don't post a question in the thread of another member. 3) Don't post questions regarding breaking or bypassing any security measure. 4) Acknowledge the responses you receive, good or bad. 5) Cross-promotion of, or links to, forums competitive to this forum in signatures are prohibited. NOTE : Don't ever post personal or confidential data in a workbook. Forum owners and members are not responsible for any loss. ---------------------------------------------------------------------------- -------------------------- To post to this group, send email to excel-macros@googlegroups.com -- FORUM RULES (986+ members already BANNED for violation) 1) Use concise, accurate thread titles. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get quick attention or may not be answered. 2) Don't post a question in the thread of another member. 3) Don't post questions regarding breaking or bypassing any security measure. 4) Acknowledge the responses you receive, good or bad. 5) Cross-promotion of, or links to, forums competitive to this forum in signatures are prohibited. NOTE : Don't ever post personal or confidential data in a workbook. Forum owners and members are not responsible for any loss. ------------------------------------------------------------------------------------------------------ To post to this group, send email to excel-macros@googlegroups.com