Sub RangeBulkAmend()
Set list = list.CreateInstance
Dim c As Range
Dim i As Long
Dim myarr() As Variant
For Each c In Selection
list.Add c.value
Next c
ReDim myarr(list.Count - 1)
For i = 1 To list.Count - 1
myarr(i) = list.Items(i)
msg = msg & vbCrLf & myarr(i)
Next i
{{ListWindow.ListBox1.list = myarr}}
Load ListWindow
ListWindow.Show
end sub
i have an error on the compile as I try to pass my array to a list the code with double braces that where the compiler points too but if I highlight i get the message Object variable or With block variable not set any help will be gladly appreciated thank you in advance please note the list refereed to in the code above is my own custom list the issue is sending the array to the list box at the double braces checked the code it produces something now to extract that to a list box
myarr=selection.Valuethen looping through it to load your list, usingfor i = LBound(myarr) to Ubound(myarr). this is not the answer but a suggestion.UBoundof your array (which is not VBA default). So you might want to addOption Base 1to your VBA module (above / before all subs).