Biased Historian,
With your raw data in Sheet1, per you latest workbook, try the following macro.
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).
1. Copy the below code, by highlighting the code and pressing the keys CTRL + C
2. Open your workbook
3. Press the keys ALT + F11 to open the Visual Basic Editor
4. Press the keys ALT + I to activate the Insert menu
5. Press M to insert a Standard Module
6. Where the cursor is flashing, paste the code by pressing the keys CTRL + V
7. Press the keys ALT + Q to exit the Editor, and return to Excel
8. To run the macro from Excel, open the workbook, and press ALT + F8 to display the Run Macro Dialog. Double Click the macro's name to Run it.
Option Explicit
Sub ReorgData()
' stanleydgromjr, 12/18/2010
' http://www.excelforum.com/excel-programming/757145-formatting-issue-for-an-itemized-list.html
Dim w1 As Worksheet, wR As Worksheet
Dim c As Range, Caddr As String
Dim LR As Long, NR As Long, SR As Long, ER As Long, a As Long
Application.ScreenUpdating = False
Set w1 = Worksheets("Sheet1")
If Not Evaluate("ISREF(Results!A1)") Then Worksheets.Add(After:=w1).Name = "Results"
Set wR = Worksheets("Results")
wR.UsedRange.Clear
w1.Activate
LR = w1.Cells(Rows.Count, 1).End(xlUp).Row
With w1.Range("A1:A" & LR)
Set c = .Find("CASE NO:*", LookIn:=xlValues, LookAt:=xlWhole)
If Not c Is Nothing Then
Caddr = c.Address
Do
SR = c.Row + 1
NR = wR.Range("B" & Rows.Count).End(xlUp).Offset(1).Row
wR.Range("A" & NR) = w1.Range("A" & SR - 1)
For a = SR To SR + 200 Step 1
If Cells(a, 1) = "VALUE:" Then
ER = a - 3
Exit For
End If
Next a
For a = SR To ER Step 12
wR.Range("B" & NR).Resize(, 12) = Application.Transpose(w1.Range("A" & a & ":A" & a + 11))
NR = NR + 1
Next a
Set c = .FindNext(c)
Loop While Not c Is Nothing And c.Address <> Caddr
End If
End With
LR = wR.Cells(Rows.Count, 2).End(xlUp).Row
wR.Range("D1:D" & LR).NumberFormat = "$#,##0.00_);($#,##0.00)"
wR.Range("G1:J" & LR).NumberFormat = "m/d/yyyy"
wR.UsedRange.Columns.AutoFit
wR.Activate
Application.ScreenUpdating = True
End Sub
Then run the ReorgData macro.
Bookmarks