• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

VBA on .csv file to run all files in one folder and give result in 1 sheet

There was an odd condition that wasn't allowed for in the code
In the code there was a filter for (blank) Product Groups, but in the data there was no Blanks, which caused the error

So I added an error check that just goes to the next line if there is an error and all fixed

Code:
  On Error Resume Next ' This is the new line
  With ActiveSheet.PivotTables("PivotTable1").PivotFields("PRODUCT GROUP")
  .PivotItems("(blank)").Visible = False

see attached file:
 

Attachments

  • Read text file contents CSV2 NEW FILE part 4.xlsm
    69.4 KB · Views: 6
Hi Hui
Thanks for fixing blanks but now when it runs MFG macro, the pivot table on last tab (deal sheet) doesn’t come in correct format as rest.
Doesn’t matter if its two tabs or 100 tabs, only the last tab gives bad format pivot format unlike rest. When I checked, it makes duplicates in values window on pivot table
Same goes for summary sheet
It gives correct result but when it finished last tab it gives error as
“method “select of object”_worksheet ‘failed”
You can use above file which you attached
 
Can you please post the file and highlight the errors as I don't see any
 
Back
Top