Sorting contents from columns to Rows
Closed
ganeshkrish85
Posts
1
Registration date
Tuesday October 21, 2014
Status
Member
Last seen
October 21, 2014
-
Oct 21, 2014 at 09:56 AM
TrowaD Posts 2921 Registration date Sunday September 12, 2010 Status Moderator Last seen December 27, 2022 - Oct 21, 2014 at 11:05 AM
TrowaD Posts 2921 Registration date Sunday September 12, 2010 Status Moderator Last seen December 27, 2022 - Oct 21, 2014 at 11:05 AM
Related:
- Sorting contents from columns to Rows
- How to sort bookmarks in chrome - Guide
- Display two columns in data validation list but return only one - Guide
- Tweetdeck larger columns - Guide
- How to delete rows and columns in word - Guide
- Clear only the formatting from the selected cell (leaving the content) - Guide
1 response
TrowaD
Posts
2921
Registration date
Sunday September 12, 2010
Status
Moderator
Last seen
December 27, 2022
555
Oct 21, 2014 at 11:05 AM
Oct 21, 2014 at 11:05 AM
Hi Ganeshkrish,
Source sheet is named Sheet1.
Destination sheet is named Sheet2.
Sheet2 should contain header as well as the unique codenames.
Using your sample data, Sheet2 looks like:
Code Name RPP UMSC Dr Price Alpha SC Lab Referral
17OHP
5HIAA
When you have met the above criteria, then try the code below:
Best regards,
Trowa
Source sheet is named Sheet1.
Destination sheet is named Sheet2.
Sheet2 should contain header as well as the unique codenames.
Using your sample data, Sheet2 looks like:
Code Name RPP UMSC Dr Price Alpha SC Lab Referral
17OHP
5HIAA
When you have met the above criteria, then try the code below:
Sub RunMe() Dim lRow As Integer Sheets("Sheet1").Select lRow = Range("A1").End(xlDown).Row x = 2 Do For Each cell In Range("A2:A" & lRow) If cell = Sheets("Sheet2").Cells(x, "A") Then Sheets("Sheet2").Cells(x, Columns.Count).End(xlToLeft).Offset(0, 1) = cell.Offset(0, 5) End If Next cell x = x + 1 Loop Until IsEmpty(Sheets("Sheet2").Cells(x, "A")) End Sub
Best regards,
Trowa