This is an example to explain how to achieve what you want. Please make changes to the code according to your needs.
Say I have Sheet1 , which looks like below. Colored cells make up from my disjoint range.

Now paste the code below in the module and run it. The output will be generated in Sheet2 and Sheet3
code
Sub Sample() Dim rng As Range, aCell As Range Dim MyAr() As Variant Dim n As Long, i As Long '~~> Change this to the relevant sheet With Sheet1 '~~> Non Contiguous range Set rng = .Range("A1:C1,B3:D3,C5:G5") '~~> Get the count of cells in that range n = rng.Cells.Count '~~> Resize the array to hold the data ReDim MyAr(1 To n) n = 1 '~~> Store the values from that range into '~~> the array For Each aCell In rng.Cells MyAr(n) = aCell.Value n = n + 1 Next aCell End With '~~> Output the data in Sheet '~~> Vertically Output to sheet 2 Sheet2.Cells(1, 1).Resize(UBound(MyAr), 1).Value = _ Application.WorksheetFunction.Transpose(MyAr) '~~> Horizontally Output to sheet 3 Sheet3.Cells(1, 1).Resize(1, UBound(MyAr)).Value = _ MyAr End Sub
Vertical output

Horizontal output

We hope that the above example will help you achieve what you want.
source share