'Excel vba resize function on filtered selected cell wrong

I have a simple function, which resize dictionary to range

ThisWorkbook.Worksheets("Sheet1").Range("K10").Resize(DU_Result.Count, UBound(DU_Result.Items(1))) = Application.Transpose(Application.Transpose(DU_Result.Items))

destination range table is not filtered, result (ok): enter image description here

destination range table is filtered order without line breaks (1,2,3,4,5,6,7,8), result (ok): enter image description here

Problem appear when destination range table is filtered order with line breaks (1,2,,,5,6,,8), result (BAD):

enter image description here expected enter image description here

So why this happens and how to fix?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source