Sub ReorientData()
Dim iLastRow As Long
Dim cDates As Long
Dim i As Long, j As Long
Dim nCalculation
Dim aryDates
With Application
.ScreenUpdating = False
nCalculation = .Calculation
.Calculation = xlCalculationManual
End With
iLastRow = Cells(Rows.Count, "A").End(xlUp).Row
cDates = Cells(Rows.Count, "B").End(xlUp).Row - 1
ReDim aryDates(1 To cDates)
For i = 1 To cDates
aryDates(i) = Cells(i + 1, "B").Value
Next i
For i = iLastRow To 2 Step -1
Rows(i + 1).Resize(cDates - 1).Insert
For j = 1 To cDates
Cells(i + j - 1, "B").Value = aryDates(j)
Next j
Cells(i, "A").Resize(cDates).Value = Cells(i, "A").Value
Next i
'reset status quo
With Application
.Calculation = nCalculation
.ScreenUpdating = True
End With
End Sub
--
HTH
Bob Phillips
(remove xxx from email address if mailing direct)
"barkiny" wrote in
message ...
In column A
There are companies (Company A, Company B....)
In column B
There are dates (01/01/2006 , 01/02/2006....)
I want to re-orient data so that
In column A the company set will be repeating assingned to each
date...
it will look like that
Company A 01/01/2006
Company B 01/01/2006
Company A 01/02/2006
Company B 01/02/2006
thanks in advance...
+-------------------------------------------------------------------+
|Filename: sheet1.zip |
|Download: http://www.excelforum.com/attachment.php?postid=4758 |
+-------------------------------------------------------------------+
--
barkiny
------------------------------------------------------------------------
barkiny's Profile:
http://www.excelforum.com/member.php...o&userid=20397
View this thread: http://www.excelforum.com/showthread...hreadid=542032