Home » excel » vba – Excel OFFSET formula to get data from horizontal to vertical

vba – Excel OFFSET formula to get data from horizontal to vertical

Posted by: admin May 14, 2020 Leave a comment

Questions:

enter image description here

I would like to reference data from Horizontal and output to vertical cell without space in between. May I know how should I use OFFSET formula to achieve the desire output in vertical?

How to&Answers:

Enter =OFFSET($H$2,0,3*(ROW()-6)) in E6 and fill down to achieve the result shown in your image.

Answer:

try this ! Change the range() if you need !

Sub macro()

'Variable declaration
Dim tbl As Range
Dim col1 As Variant

col1 = Array(1, 3, 5, 7)
Set tbl = Range("A1:A4")

With tbl
    .Value = Application.Transpose(col1)
End With

End Sub