+ Reply to Thread
Results 1 to 13 of 13

Formatting issue for an itemized list

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    06-29-2010
    Location
    Boston, Massachusetts
    MS-Off Ver
    Excel 2010
    Posts
    111

    Re: Formatting issue for an itemized list

    Attached the requested workbook. Sheet 1 contains the original information that the code provided formats. Sheet 2 shows the results of executing the code and shows what the format looks like. Sheet 3 shows the itemized list causing the issue. It is added into the original information.

    The 1st workbook attached attempts to explain where the cells need to end up so that it all looks like sheet 2. This becomes complicated (at least in my mind) because it not only needs to reorder the cells, but draw from previous cells to fill in the missing pieces.

    Here is the code provided to me, which works off of reassembling 13 cells of information per item. The additional code would need to address the issue of items that only contain 3 cells of information (because they are itemized under one number vs. one item per number) , but need the 10 other cells to draw from in order to reassemble like every other row of items.

    I know it may sound a bit confusing, thus my cell by cell breakdown by colored backgrounds in the 1st workbook.

    The code-

    Option Explicit
    
    Sub ReformatData()
    Dim CaseFND As Range
    Dim LR As Long, Rw As Long
    Dim NR As Long
        
        Application.ScreenUpdating = False
        On Error Resume Next
        
        Set CaseFND = Range("A:A").Find("Case:", LookIn:=xlValues, LookAt:=xlPart)
        If CaseFND Is Nothing Then Exit Sub
    
        Range("A1", CaseFND.Offset(-1)).Delete xlShiftUp
        LR = Range("A" & Rows.Count).End(xlUp).Row
        
        For Rw = LR To 1 Step -1
            If Range("A" & Rw).Font.Bold = False Then
                Range("A" & Rw + 1, "A" & LR).Delete xlShiftUp
                Exit For
            End If
        Next Rw
    
        LR = Range("A" & Rows.Count).End(xlUp).Row
        NR = 1
        For Rw = 2 To LR Step 12
            Range("A" & Rw).Resize(12).Copy
            Range("B" & NR).PasteSpecial xlPasteAll, Transpose:=True
            NR = NR + 1
        Next Rw
        
        Range("A2:A" & LR).ClearContents
        Columns.AutoFit
        Application.ScreenUpdating = True
    End Sub

  2. #2
    Forum Contributor
    Join Date
    06-29-2010
    Location
    Boston, Massachusetts
    MS-Off Ver
    Excel 2010
    Posts
    111

    Re: Formatting issue for an itemized list

    Attachments can't seem to be uploaded right now so i will have to wait-

    d

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1