Hi! I'm working on a project that involves fixing a DBA's mistakes. This DBA must have been especially dense!
What I'm looking at is a list of lessons (Lesson ID, Lesson Date, etc.). There is a column in the sheet called Listed Participants. This field has MULTIPLE participant ID's in it. The DBA should have listed each participant with a lesson ID as a single record, rather than clumping them all together.
I'm at the point now, where I need to separate each Participant ID, insert some rows, and use the lesson ID as the first column and the participant ID as the second column. I'm not sure if I need a lookup. I've already separated the participant ID column into multiple columns (one for each participant ID), using the Text To Columns feature. I have a column that counts the number of participant columns (this number is used to tell the VBA how many rows to insert) I can (through VBA) insert rows in the spreadsheet to accomodate for the new records, but I'm having difficulty telling the system what to copy and where.
Here's what I HAVE:
Lesson ID ------------------------------------------------------ Listed Participants
-----------------------------------------------------------------------------------------------------
2594 ----------------------------------------------------------> 1525, 1425, 4487, 6698
4796 ----------------------------------------------------------> 3468, 1711, 5689
Here's what I NEED
Lesson ID -----------------------------------------------------Participant ID
----------------------------------------------------------------------------------------
2594 --------------------------------------------------------->1525
2594---------------------------------------------------------->1425
2594---------------------------------------------------------->4487
2594---------------------------------------------------------->6698
4796---------------------------------------------------------->3468
4796---------------------------------------------------------->1711
4796---------------------------------------------------------->5689
Now, you ask why I don't just do this manually. I have 4455!!!!!! lessons with multiple participants and need to speed this up.
Any recommendations? Thanks so much! I don't expect code answers (I think I can handle the code), but maybe some insight into how to approach this in a way that doesn't involve throwing the DBA in a lake. Thanks again!
KellyJo
Last edited by KatBloom; 08-03-2011 at 03:45 PM. Reason: Formatting bad
KatBloom,
Welcome to the Excel Forum.
To get the most precise answer, it is best to upload/attach a sample workbook (sensitive data scrubbed/removed/changed) that contains an example of your raw data on one worksheet, and on another worksheet your desired results.
The structure and data types of the sample workbook must exactly duplicate the real workbook. Include a clear and explicit explanation of your requirements.
To attach your workbook, scroll down and click on the Go Advanced button, then scroll down and click on the Manage Attachments button.
Have a great day,
Stan
stanleydgromjr
Windows Vista Business, Excel 2003 and 2007
If you are satisfied with the solution(s) provided, please mark your thread as Solved by clicking EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.
Thanks for the welcome! I'm unclear about what in my post was unclear. I posted the sample data, and am looking for insight, not direct code. Any ideas would be greatly appreciated. Thanks!
KellyJo
Hi KatBloom. If you're familiar with VBA code, you should be able to loop through the array of Participant IDs without much trouble. Does the data in your spreadsheet actually look like what you've posted, including the dashes and greater than signs? Do you need to have the data on the same sheet or could you put it in a new sheet? If it were me, I'd use a new sheet to put the new format and then use either a counting method or the cells(rows.count, [pastecolumn]).end(xlup) method to input to the next empty row.
-GregIf this is helpful, pls click Star icon in lower left corner
Hello KatBloom,
With 2 helper columns. See the attached.
HTH; Haseeb
If your problem is solved, please say so clearly, and mark your thread as Solved:
Forum Rules & How to Mark a thread as SOLVED
Haseeb, are you kidding me?! You ROCK! How simple your solution is. I never would have thought of it. Thanks so much! I really appreciate it!
KellyJo
KatBloom,
By what you posted we can not tell what worksheet/columns/rows the data is in.I posted the sample data
A macro solution would be very easy to create. The Listed Participants cells can be Split, and new rows inserted, to accomodate your request.
Last edited by stanleydgromjr; 08-04-2011 at 12:11 AM.
Have a great day,
Stan
stanleydgromjr
Windows Vista Business, Excel 2003 and 2007
If you are satisfied with the solution(s) provided, please mark your thread as Solved by clicking EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks