![]() |
| If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|||||||
|
|
Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
I have this data in my spread sheet
Header- MemberID, Plan, Coverage Type, Premium Row 1 - ABC, Health, IND, $100 Row 2 - ABC, Dental, FAM, $50 Row 3 - ABC, Vision, FAM, $25 Is there a way I can combine the rows to get this: Header - MemberID, Plan, Coverage Type, Premium, Plan, Coverage Type, Premium, Plan, Coverage Type, Premium Row 1 - ABC, Health, IND, $100, Dental, FAM, $50, Vision, FAM, $25 I have multiple memebers in my spreadsheet and the data all runs vertically and I want to combine it and go horizontal. Any help is greatly appreciated! |
| Ads |
|
#2
|
|||
|
|||
|
On Monday, August 6, 2012 3:53:31 PM UTC-5, (unknown) wrote:
> I have this data in my spread sheet > > > > Header- MemberID, Plan, Coverage Type, Premium > > Row 1 - ABC, Health, IND, $100 > > Row 2 - ABC, Dental, FAM, $50 > > Row 3 - ABC, Vision, FAM, $25 > > > > Is there a way I can combine the rows to get this: > > Header - MemberID, Plan, Coverage Type, Premium, Plan, Coverage Type, Premium, Plan, Coverage Type, Premium > > Row 1 - ABC, Health, IND, $100, Dental, FAM, $50, Vision, FAM, $25 > > > > > > I have multiple memebers in my spreadsheet and the data all runs vertically and I want to combine it and go horizontal. > > > > Any help is greatly appreciated! Try this macro Sub putonrowsSAS() Dim i As Long Dim lc As Long For i = Cells(Rows.Count, 1).End(xlUp).Row To 2 Step -1 lc = Cells(i, Columns.Count).End(xlToLeft).Column + 1 If Cells(i + 1, 1) = Cells(i, 1) Then Cells(i + 1, 2).Resize(, 200).Copy Cells(i, lc) Rows(i + 1).Delete End If Next i End Sub |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Select and rows to another cell if one of the cells contains data | schleprock | Excel Programming | 2 | February 5th 09 07:41 PM |
| How to select Visible Cells range minus 2 rows (frozen panes) | LuisE | Excel Programming | 5 | November 22nd 07 05:01 AM |
| select only used rows and only visible cells | Rokuro kubi | Excel Discussion (Misc queries) | 2 | September 28th 06 02:06 PM |
| Select filled cells/rows in a spreadsheet | [email protected] | Excel Programming | 2 | December 1st 05 12:29 AM |
| How do you select two cells in different rows and columns with ou. | M.G | Excel Discussion (Misc queries) | 3 | December 17th 04 11:39 PM |