data manipulation

joserdsousa

New Member
Joined
Dec 17, 2017
Messages
4
hello there guys


I'm having trouble passing this data from this format:
"


Day
| 00:15 | 00:30 | 00:45 ... | 23:45
01/jan | 32 | 30 | 40 ... | 45
02/jan | 45 | 50 | 52 ... | 60




"




to this format:


"


01/jan | 00:15 | 32
01/jan | 00:30 | 30
01/jan | 00:45 | 40
.
.
.


01/jan | 23:45 | 45
02/jan | 00:15 | 45
02/jan | 00:30 | 50
02/jan | 00:45 | 52
.
.
.
02/jan | 23:45 | 60




"


I'm doing a transposition of the data, but that is
taking too much of my time. I have almoust 1 million of cell values
to organize in that way...




if anyone could help me I would be much gratefull!
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
you haven't said where you want the results so I have written it out to a new tab " temp"
Code:
Sub test2()
lastrow = Cells(Rows.Count, "A").End(xlUp).Row
' I assume there are 96 colums (24*4)
inarr = Range(Cells(1, 1), Cells(lastrow, 96))
Dim outarr()
ReDim outarr(1 To 96 * lastrow, 1 To 3)


indi = 2
For i = 2 To lastrow
  For j = 2 To 96
   outarr(indi, 1) = inarr(i, 1)
   outarr(indi, 2) = inarr(1, j)
   outarr(indi, 3) = inarr(i, j)
   indi = indi + 1
  Next j
Next i


    With ThisWorkbook
        .Sheets.Add(After:=.Sheets(.Sheets.Count)).Name = "Temp"
    End With
ActiveWorkbook.Worksheets("temp").Select
Range(Cells(1, 1), Cells(96 * lastrow, 3)) = outarr


End Sub
 
Upvote 0

Forum statistics

Threads
1,223,228
Messages
6,170,871
Members
452,363
Latest member
merico17

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