So each respondent will select their option out of these six options, which I am going to show in separate colors in Agenda Sheet (Excel file) where I need to run this requested code/script.Īgainst, each question I have 7 cells – The first sex cells for the options and the 7th cell for the consensus choice. Lets say, I have 5 respondents for each survey. This imported survey data has 6 (Six) options (1, 2, 3, 4, 5, and N/A) for each survey question. I have a survey form send to various survey respondents which is now completed and I have already exported it as an Excel File. MsgBox 'Your Pivot Table is now updated.'Ĭould somebody help me create a macro script for the following routine. Pivot_Sheet.PivotTables(PivotName).RefreshTable PivotCaches.Create(SourceType:=xlDatabase, SourceData:=NewRange) 'Change Pivot Table Data Source Range Address NewRange = Data_Sheet.Name & '!' & DataRange.Address(ReferenceStyle:=xlR1C1) Set DataRange = Data_Sheet.Range(StartPoint, Cells(DownCell, LastCol)) LastCol = StartPoint.End(xlToRight).Column Set Pivot_Sheet = ThisWorkbook.Worksheets('Pivot3') Set Data_Sheet = ThisWorkbook.Worksheets('PivotTableData3')