Here i'am using Multidimension array to get faster result
This will little longer in code, but will much faster then Direct
Manipulation Data using For Each ... in Range... Next (Loop)
And then... Here we go...
Sub Convert()
Dim Data, Hasil, LCount As Long, LRow As Long, iCol As Integer
Dim Timex As Double
'Start Timer
Timex = Timer
'Define the result location
Set ResLoc = Sheet2.Range("F1")
'Collect Data and store to array
Data = Sheet1.UsedRange.Value
'Resize Result Variable to Store Processed Data
ReDim Hasil(1 To ((UBound(Data, 1) * UBound(Data, 2)) - 2), 1 To 4)
LCount = 1
'Create Header
Hasil(LCount, 1) = "SONG NAME"
Hasil(LCount, 2) = "ALBUM"
Hasil(LCount, 3) = "Downloads"
Hasil(LCount, 4) = "Date"
'Loop Entire Data Column
For iCol = 3 To UBound(Data, 2) - 1
'Loop Entire Data Row
For LRow = 2 To UBound(Data, 1)
LCount = LCount + 1
'Assign the result with respected data
Hasil(LCount, 1) = Data(LRow, 1)
Hasil(LCount, 2) = Data(LRow, 2)
Hasil(LCount, 3) = Data(LRow, iCol)
Hasil(LCount, 4) = Data(1, iCol)
Next
Next
'Paste the data to Sheet, we need to resize it first to get same
dimension with Hasil dimension
ResLoc.Resize(UBound(Hasil, 1), UBound(Hasil, 2)) = Hasil
'Create Border
ResLoc.CurrentRegion.Borders.LineStyle = xlContinuous
'Resize the column width to fit with cell data
ResLoc.CurrentRegion.EntireColumn.AutoFit
'Format Column Date as Date
Range(ResLoc, ResLoc.End(xlDown)).Offset(, 3).NumberFormat =
"[$-409]dd/mmm/yy;@"
'Show the Processing Time
MsgBox "Done in " & Timer - Timex & " seconds"
End Sub
--
Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? It’s
=TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @
https://www.facebook.com/discussexcel
FORUM RULES
1) Use concise, accurate thread titles. Poor thread titles, like Please Help,
Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get
quick attention or may not be answered.
2) Don't post a question in the thread of another member.
3) Don't post questions regarding breaking or bypassing any security measure.
4) Acknowledge the responses you receive, good or bad.
5) Jobs posting is not allowed.
6) Sharing copyrighted material and their links is not allowed.
NOTE : Don't ever post confidential data in a workbook. Forum owners and
members are not responsible for any loss.
---
You received this message because you are subscribed to the Google Groups "MS EXCEL AND VBA MACROS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to excel-macros+unsubscr...@googlegroups.com.
To post to this group, send email to excel-macros@googlegroups.com.
Visit this group at http://groups.google.com/group/excel-macros.
For more options, visit https://groups.google.com/groups/opt_out.