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 January 16, 2023 - Oct 21, 2014 at 11:05 AM
TrowaD Posts 2921 Registration date Sunday September 12, 2010 Status Moderator Last seen January 16, 2023 - Oct 21, 2014 at 11:05 AM
Related:
- Sorting contents from columns to Rows
- How to sort bookmarks in chrome - Guide
- Excel data validation list from table multiple columns - Guide
- Excel match two columns and output third ✓ - Excel Forum
- Excel vba copy rows to another worksheet based on criteria ✓ - Excel Forum
1 reply
TrowaD
Posts
2921
Registration date
Sunday September 12, 2010
Status
Moderator
Last seen
January 16, 2023
547
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