Vertical to horizontal

Zubair

Active Member
Joined
Jul 4, 2009
Messages
304
Office Version
  1. 2016
Platform
  1. Windows
Hi Experts,

A very long data is available in column A, I want the formula to bring data horizontally from column b to j, please help

DateCost 1Cost 2Cost 3Cost 4Cost 5Cost 6Cost 7Cost 8
Sunday, April 16, 2006
28.5​
0.88​
13.86​
2.3​
1.59​
1.82​
7.34​
56.29​
Monday, May 01, 2006
29.89​
0.88​
12.72​
3.18​
1.63​
1.87​
7.53​
57.7​
Sunday, April 16, 2006
28.5​
0.88​
13.86​
2.3​
1.59​
1.82​
7.34​
56.29​
Monday, May 01, 2006
29.89​
0.88​
12.72​
3.18​
1.63​
1.87​
7.53​
57.7​
Tuesday, May 16, 2006
30.31​
0.88​
12.3​
3.18​
1.63​
1.87​
7.53​
57.7​
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
Are those dates in column A text values or are they actual dates (numbers) formatted to show day, month etc?
 
Upvote 0
Actually, might not need that information since your data seems very regular.
Test this with a copy of your data.
Assumes that first date is in A4

VBA Code:
Sub Vert_Horiz_1()
  Dim i As Long
 
  Application.ScreenUpdating = False
  For i = 4 To Range("A" & Rows.Count).End(xlUp).Row Step 9
    Range("A" & i).Resize(9).Copy
    Range("B" & Rows.Count).End(xlUp).Offset(1).PasteSpecial Paste:=xlPasteValues, Transpose:=True
  Next i
  Application.CutCopyMode = False
  Application.ScreenUpdating = True
End Sub
 
Upvote 0
Solution
try this

Rename v3.03.xlsm
ABCDEFGHIJ
1DateCost 1Cost 2Cost 3Cost 4Cost 5Cost 6Cost 7Cost 8
2Sunday, April 16, 200628.50.8813.862.31.591.827.3456.29
3Monday, May 01, 200629.890.8812.723.181.631.877.5357.7
4Sunday, April 16, 2006
528.5
60.88
713.86
82.3
91.59
101.82
117.34
1256.29
13Monday, May 01, 2006
1429.89
150.88
1612.72
173.18
181.63
191.87
207.53
2157.7
22Tuesday, May 16, 2006
2330.31
240.88
2512.3
263.18
271.63
281.87
297.53
Sheet3
Cell Formulas
RangeFormula
C2:J3C2=TRANSPOSE(OFFSET($A$1,MATCH(B2,A:A,0),0,8))
Dynamic array formulas.
 
Upvote 0
Actually, might not need that information since your data seems very regular.
Test this with a copy of your data.
Assumes that first date is in A4

VBA Code:
Sub Vert_Horiz_1()
  Dim i As Long
 
  Application.ScreenUpdating = False
  For i = 4 To Range("A" & Rows.Count).End(xlUp).Row Step 9
    Range("A" & i).Resize(9).Copy
    Range("B" & Rows.Count).End(xlUp).Offset(1).PasteSpecial Paste:=xlPasteValues, Transpose:=True
  Next i
  Application.CutCopyMode = False
  Application.ScreenUpdating = True
End Sub
Thanks, Peter it's perfectly working
 
Upvote 0

Forum statistics

Threads
1,215,655
Messages
6,126,054
Members
449,283
Latest member
GeisonGDC

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top