Consulting

Results 1 to 5 of 5

Thread: Excel spreadsheet help

  1. #1
    VBAX Regular
    Joined
    Jun 2008
    Posts
    18
    Location

    Excel spreadsheet help

    Hello,

    I have a spreadsheet that is kind of messy despite many "paste special" attempts I tried. The first column lists names but last and first names are in different columns and the grade info in following columns is in a row that consists of the first to rows (last, first), merged. (Sorry that's the best I can describe).

    I have attached the workbook (only 1 sheet), and its as cleaned-up as I could get it. If someone could help me I would greatly appreciate it...

    I want the rows to be in the format:

    STUDENT | Resp | Comp | Task | ...
    last, first | 43 | 52 | 32 | ... (one row)
    .... etc...



    Hopefully I have explained this well enough.

    Thanks,
    Jay

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    You forgot to say what the question was.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    VBAX Regular
    Joined
    Jun 2008
    Posts
    18
    Location
    Sorry....

    I want the rows to be in the format:

    STUDENT | Resp | Comp | Task | ...
    last, first | 43 | 52 | 32 | ... (one row)
    .... etc...


    As of now, the last and first name are in different rows. My question is can you help me with a code/macro that will let me condense the name into one cell in the format (last,first)?

  4. #4
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    [vba]

    Public Sub ProcessData()
    Dim LastRow As Long
    Dim i As Long, j As Long

    With Application

    .ScreenUpdating = False
    .Calculation = xlCalculationManual
    End With

    With ActiveSheet

    LastRow = .Cells(.Rows.Count, "A").End(xlUp).Row
    For i = LastRow To 2 Step -2

    .Cells(i - 1, "A").Value = .Cells(i - 1, "A").Value & " " & .Cells(i, "A").Value
    For j = 2 To 11: .Cells(i - 1, j).UnMerge: Next j
    .Cells(i - 1, "A").WrapText = False
    .Rows(i).Delete
    Next i

    .Columns(1).AutoFit
    End With

    With Application

    .Calculation = xlCalculationAutomatic
    .ScreenUpdating = True
    End With

    End Sub
    [/vba]
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  5. #5
    VBAX Regular
    Joined
    Jun 2008
    Posts
    18
    Location
    Awesome. thank you once again XLD

Posting Permissions

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