Solved

Macro for xls report

Posted on 2014-09-10
2
264 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 48

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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
Many companies are making the switch from Microsoft to Google Apps (https://www.google.com/work/apps/business/). Use this article to learn more about what Google Apps has to offer and to help if you’re planning on migrating to Google Apps. It is …
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.

760 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now