Solved

Macro for xls report

Posted on 2014-09-10
2
272 Views
Last Modified: 2014-09-10
I have the attached an excel report. I need a macro to do the following:

Each row contains an applicant/student.
Starting from column AB (and onwards) there are sports listed. Some students have multiple sports listed in each column (one sport in each column).
I would like a macro that can combine each sport for each student into their AB column.  

So as an example (see attached). John Doe on row 2 has sports listed from AB to AH. The macro would combine all the sports in these column into AB (each sport on a new line in the AB cell).
Jane Doe has sports listed from AB to AX. These sports should be combined into AB (each sport on a separate line in the cell AB).

The macro should process each row where here is a student/applicant listed.
Hope you can help.

Much appreciated.

IV
Visitors.xls
0
Comment
Question by:ivanoviola
2 Comments
 
LVL 49

Accepted Solution

by:
Rgonzo1971 earned 500 total points
ID: 40314595
Hi,

pls try

Sub macro()
Dim arrRange
For Each c In Range("AB2", Range("AB" & Rows.Count).End(xlUp))
    Set myRange = Range(c, c.End(xlToRight))
    arrRange = myRange
    myRange.ClearContents
    c.Value = Join(WorksheetFunction.Index(arrRange, 1, 0), Chr(10))
Next
End Sub

Regards
VisitorsV1.xls
0
 
LVL 21

Author Closing Comment

by:ivanoviola
ID: 40314882
Great....thanks for your help.
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Hiding information in Excel 16 70
Compare 3,000cells with each one of 500,000 cells, how? 83 48
New Criteria Prototype 3 18
Best Excel  formula for  this scenario 2 35
Article by: Leon
Software Metering within our group of companies has always been an afterthought until auditing of software and licensing became a pain point. Orchestrator and SCCM metering gave us the answer and it was an exciting process.
Excel can be a tricky bit of software to get your head around. Whilst you’ll be able to eventually get to grips with the basic understanding of how to get by, there are a few Excel tips that not everybody will even know about let alone know how to d…
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question