Sub CollectionTest() ''e27
Dim myCollection As New Collection
Dim i As Integer
myCollection.Add "Item1"
myCollection.Add "Item2"
myCollection.Add "Item3"
Range("A1").Select
For i = 1 To myCollection.Count
ActiveCell.value = i
ActiveCell.Offset(0, 1).value = myCollection(i)
ActiveCell.Offset(1, 0).Select
Next i
End Sub
(function() {
var oSheet = Api.GetActiveSheet();
let myCollection = new Set();
myCollection.add("Item1");
myCollection.add("Item2");
myCollection.add("Item3");
var oCell = oSheet.GetRange("A1");
oCell.Select();
var i = 1;
for (let item of myCollection) {
oCell.SetValue(i++);
oCell.SetOffset(0, 1);
oCell.SetValue(item);
oCell.SetOffset(1, -1);
oCell.Select();
}
})();