Dim arrNPSQuestions = Survey.Questions.FilterByTag("NPS") ' tagged: R2 Dim arrScale5Questions = Survey.Questions.FilterByTag("5pt Scale Brand Loop") ' tagged: B5 Dim arrScale7Questions = Survey.Questions.FilterByTag("7pt Scale Brand Loop") ' tagged: R4 Dim clonePortfolio As Portfolio Dim resPortfolio As Portfolio Dim resItem As PortfolioItem Dim ProfileRow as Profile Dim h For h = 1 to Survey.Questions.Count Dim currQuestion = Survey.Questions[h] If currQuestion.IsCoding = False Then ' required to remove the coding questions created for R4 (R4 TB2) If arrNPSQuestions.FindByShortcut(currQuestion.Shortcut).Shortcut <> "" Then clonePortfolio.Read("NPS set-up (0-10).xml",True) ProfileRow.Add(clonePortfolio.Items[1].TabDef.Rows.Clone(currQuestion)) ElseIf arrScale5Questions.FindByShortcut(currQuestion.Shortcut).Shortcut <> "" Then clonePortfolio.Read("Scaled.xml",True) ProfileRow.Add(clonePortfolio.Items[1].TabDef.Rows.Clone(currQuestion)) ElseIf arrScale7Questions.FindByShortcut(currQuestion.Shortcut).Shortcut <> "" Then clonePortfolio.Read("Scaled.xml",True) ProfileRow.Add(clonePortfolio.Items[2].TabDef.Rows.Clone(currQuestion)) Endif Endif Next h resItem.SetType(1) resItem.SetTitle("Scaled Questions with Clones for Nets/Cals") resItem.TabDef.Rows.Add(ProfileRow) ' add the rows to the tab definition resItem.TabDef.ReadTabTemplate("Askia Simple") resPortfolio.Add(resItem) resPortfolio.Save(Survey.Directory + "9. Add Groups, Nets & Scaled Values Using Clones.xml") resPortfolio.Open()