+ Reply to Thread
Results 1 to 2 of 2

Thread: Creating new entries

  1. #1
    eclipse
    Guest

    Creating new entries

    Hi All,

    I have a spreadsheet containing students' grades in this format:

    M Wakefield A C D
    A Sky F E B


    What I would like to generate from the data above is this:


    M Wakefield A
    M Wakefield C
    M Wakefield D
    A Sky F
    A Sky E
    A Sky B



    I have about 2000 entries, any help will be much appreciated.



    Terapixels



  2. #2
    Toppers
    Guest

    RE: Creating new entries

    Hi,
    Data from Sheet1 - starting in col A, Row 2 - is copied to Sheet2:


    HTH

    Sub Transform()

    Dim ws1 As Worksheet, ws2 As Worksheet
    Dim lastrow As Long, r As Long, i As Integer

    Set ws1 = Worksheets("sheet1")
    Set ws2 = Worksheets("sheet2")

    rr = 2
    ws2.Range("A1:B1") = Array("Student", "Grade")
    With ws1
    For r = 2 To .Cells(Rows.Count, 1).End(xlUp).Row
    For i = 2 To .Cells(r, Columns.Count).End(xlToLeft).Column
    .Cells(r, 1).Copy ws2.Cells(rr, 1)
    .Cells(r, i).Copy ws2.Cells(rr, 2)
    rr = rr + 1
    Next i
    Next r
    End With

    End Sub

    "eclipse" wrote:

    > Hi All,
    >
    > I have a spreadsheet containing students' grades in this format:
    >
    > M Wakefield A C D
    > A Sky F E B
    >
    >
    > What I would like to generate from the data above is this:
    >
    >
    > M Wakefield A
    > M Wakefield C
    > M Wakefield D
    > A Sky F
    > A Sky E
    > A Sky B
    >
    >
    >
    > I have about 2000 entries, any help will be much appreciated.
    >
    >
    >
    > Terapixels
    >
    >
    >


+ 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.2.0