Hi, I'm new to all this VBA coding so forgive me because I know this question has been around in various guises before but I cant find the code to do exactly what I need to do. Here goes...
I have a workbook with the worksheets named Complaint Chart, Pivot Table, Pivot Charts.
I run a user form which allows the user to add complaints to the next blank line on the Complaint Charts worksheet, (I have named the range of data currently there ComplaintData). The pivot tables (x3 named PTComplaintsByDay, PTCreditValueByDay and PTComplaintsByType) are populated from the named range (ComplaintData). They also lead into the pivot charts which have slicers attached.
I have a button on the user form to show the Pivot Charts worksheet but this doesn't update the pivot tables and charts to include any new complaints that have been entered since I named the data range. So what I need to do is produce code to dis-connect the slicers, change the named range to include any new complaints that have been entered, refresh the pivot tables and then re-connect the slicers.
I have seen some examples of code to do most of those things individually but I have been unable to combine them together to get it to work.
Any help on how to produce this code or any examples of code that may do this with my small knowledge to adapt it would be very gratefully received.
I have a workbook with the worksheets named Complaint Chart, Pivot Table, Pivot Charts.
I run a user form which allows the user to add complaints to the next blank line on the Complaint Charts worksheet, (I have named the range of data currently there ComplaintData). The pivot tables (x3 named PTComplaintsByDay, PTCreditValueByDay and PTComplaintsByType) are populated from the named range (ComplaintData). They also lead into the pivot charts which have slicers attached.
I have a button on the user form to show the Pivot Charts worksheet but this doesn't update the pivot tables and charts to include any new complaints that have been entered since I named the data range. So what I need to do is produce code to dis-connect the slicers, change the named range to include any new complaints that have been entered, refresh the pivot tables and then re-connect the slicers.
I have seen some examples of code to do most of those things individually but I have been unable to combine them together to get it to work.
Any help on how to produce this code or any examples of code that may do this with my small knowledge to adapt it would be very gratefully received.