I have an array that is set to variant and then redim preserved. I can see it's clearly populated in the locals window however it's not showing on sheet when I transpose it:
dim arComments() as variant
n=sheet1.cells(rows.count,"a").end(xlup).row-1
redim preserve arComments(1 to n)
for i= 1 to n
on error resume next
id=sheet1.cells(i+1,"a")
comments=application.worksheetfunction.vlookup(id,sheet2.range("tbldata"),2,0)
if err.number<>0 then
comments=sheet1.cells(i+1,"b")
end if
arComments(i)=comments
next i
sheet3.range("b2:b" & n+1)=application.worksheetfunction.transpose (arComments)
Similar code works for another two routines but this one is stubborn. I don't know why it comes up empty.
Bookmarks