Ask Me Help Desk

Ask Me Help Desk (https://www.askmehelpdesk.com/forum.php)
-   Spreadsheets (https://www.askmehelpdesk.com/forumdisplay.php?f=395)
-   -   Create Index by wrapping columns (multi page) (https://www.askmehelpdesk.com/showthread.php?t=334564)

  • Mar 27, 2009, 09:31 AM
    TheStoneCrusher
    Create Index by wrapping columns (multi page)
    I am trying to create a 'book' for karaoke. I have a program that will allow me to read file names into Excel.

    The file names contain two columns: one for song title, and one for artist. The problem is that it will be close to 70 pages (10pts). If I could convert with wrap or something to four columns on a page it would be a great help.

    I looked at other postings by people who were trying to get two pages into one. Their solutions did not work for me. Can you help? I am using Excel 2002.

    Goodwill,
    Luke
  • Mar 27, 2009, 10:38 AM
    JBeaucaire
    1 Attachment(s)

    This macro will parse your data in columns A/B into fourths and place in columns D/E, G/H and J/K.
    Code:

    Sub Fourths()
    Dim lastrow As Long, nextend As Long
    lastrow = ActiveSheet.UsedRange.Rows.Count
    nextend = Int(lastrow / 4)

        Range("A" & nextend, "B" & nextend * 2).Copy
        Range("D2").PasteSpecial xlPasteAll
        Range("A" & nextend, "B" & nextend * 2).Delete Shift:=xlUp
       
        Range("A" & nextend, "B" & nextend * 2).Copy
        Range("G2").PasteSpecial xlPasteAll
        Range("A" & nextend, "B" & nextend * 2).Delete Shift:=xlUp
       
        Range("A" & nextend, "B" & nextend * 2).Copy
        Range("J2").PasteSpecial xlPasteAll
        Range("A" & nextend, "B" & nextend * 2).Delete Shift:=xlUp
    End Sub

    Attached is a sample workbook you can test it out on.

    To add the macro to your own workbook:
    1. Press Alt-F11 to open the VBEditor
    2. Click Insert > Module
    3. Paste in the code above
    4. Alt-F11 to close the editor
    5. Save your book
    6. Alt-F8 to see the macro list
    7. Run the macro "Fourths"

  • All times are GMT -7. The time now is 03:44 PM.