robinc1969,
The following macro creates two separate arrays for columns G and I, instead of one array for columns GHI. I was not sure what column H is being used for.
Please TEST this FIRST in a COPY of your workbook (always make a backup copy before trying new code, you never know what you might lose).
Option Explicit
Sub ReorgDataV2()
' stanleydgromjr, 01/14/2013
' http://www.excelforum.com/newreply.php?do=postreply&t=890900
Dim e As Variant, g As Variant, i As Variant, lr As Long, r As Long, s As Long
e = Range("E5").CurrentRegion
lr = Cells(Rows.Count, "G").End(xlUp).Row
If lr > 3 Then Range("G4:G" & lr).ClearContents
lr = Cells(Rows.Count, "I").End(xlUp).Row
If lr > 3 Then Range("I4:I" & lr).ClearContents
ReDim g(1 To UBound(e, 1) / 2, 1 To 1)
ReDim i(1 To UBound(e, 1) / 2, 1 To 1)
For r = 1 To UBound(e, 1) Step 2
s = s + 1
g(s, 1) = e(r, 1)
i(s, 1) = e(r + 1, 1)
Next r
Range("G4").Resize(UBound(i, 1)) = g
Range("G4").Resize(UBound(i, 1)).NumberFormat = "0.00"
Range("I4").Resize(UBound(i, 1)) = i
End Sub
Before you use the macro with Excel 2007 or newer, save your workbook, Save As, a macro enabled workbook with the file extension .xlsm
Then run the ReorgDataV2 macro.
Have a great day,
Stan
Bookmarks