Respected gurus, experts and MVPs,
I have written the following code for the pivot table and it is generating pi.Visible - Type Mismatch error.
I had a similar error for the 2 other worksheets but after debugging for more than 5 hours, I could trace the lastrow mismatch error. The lastrow in the source worksheet for the Pivot Table was updated consisting of rows with irrelevant data inadvertently while debugging. When I noticed the range of data for Pivot Table and last row number different I deleted the irrelevant data, ran macro which updated the lastrow correctly and the filtered the date correctly.
In the existing worksheet, the dates in the source worksheet are in date data type and the currep_date variable is set in date data type. I have been scratching my head for more than I did for before and researching articles in many websites to identify the error but I am still clueless.
I appreciate for your time and sharing your valuable knowledge and request for any alternative solution to filter dates without changing the date datatype. I am attaching the worksheet and the picture file for your reference. When I changed the date to “General” NumberFormat it worked.
Kind regards,
Roshan Shakya
Bookmarks