Dim resPortfolio As Portfolio Dim ProfileRow as Profile ' Define a profile of row questions to add to ' Define the array of questions tagged as 'Demographics' Dim arrRowQuestions = Survey.Questions.FilterByTag("Demographics") Dim resItem As PortfolioItem Dim h For h = 1 to Survey.Questions.Count ' Prepare to iterate through every question of the survey Dim currQuestion = Survey.Questions[h] If arrRowQuestions.FindByShortcut(currQuestion.Shortcut).Shortcut <> "" Then ' Only for Demographics ProfileRow.Add(currQuestion) ' Add the matched question to the row question profile Endif Next h ' Move on to the next question resItem.SetType(1) resItem.SetTitle("Demographics Holecount") resItem.TabDef.ReadTabTemplate("Askia Simple") resItem.TabDef.Rows.add(ProfileRow) ' Add the row question profile to the tab definition resPortfolio.Add(resItem) ' Add the tab definition to the portfolio resPortfolio.Save(Survey.Directory + "6. Holecount - Questions Selected Using Tags.xml") resPortfolio.Open()