This will help you! Enjoy it! You didn't supply info about session ....
Sub Unpivot() Dim row As Long Dim col As Long 'Where to put the unpivoted array ' Should be in another sheet but you've put it on the same ..?!. Dim row_dest As Long row_dest = 10 'To simplify the algo Dim PROGRAM, ROLLNO, CENTRE, MEDIUM, SUBJECTX As String 'Begin with line 2 row = 2 PROGRAM = Cells(row, 1).Value While (PROGRAM <> "") ROLLNO = Cells(row, 2).Value CENTRE = Cells(row, 3).Value MEDIUM = Cells(row, 4).Value col = 5 SUBJECTX = Cells(row, col).Value While (SUBJECTX <> "") Cells(row_dest, 1).Value = PROGRAM Cells(row_dest, 2).Value = ROLLNO Cells(row_dest, 3).Value = CENTRE Cells(row_dest, 4).Value = MEDIUM Cells(row_dest, 5).Value = SUBJECTX row_dest = row_dest + 1 col = col + 1 SUBJECTX = Cells(row, col).Value Wend row = row + 1 PROGRAM = Cells(row, 1).Value Wend End Sub On Nov 12, 2:30 pm, Jitender <jitenderdev...@gmail.com> wrote: > DEAR SIR/GURUS > > PLEASE SOLVE THE PUZZLE IN FILE . TRANSPOSE IS NOT A GOOD SOLUTION > > THANKS > -- > Jitender > > PROBLEM.xls > 22KViewDownload -- ---------------------------------------------------------------------------------- Some important links for excel users: 1. Excel and VBA Tutorials(Video and Text), Free add-ins downloads at http://www.excelitems.com 2. Excel tutorials at http://www.excel-macros.blogspot.com 3. Learn VBA Macros at http://www.vbamacros.blogspot.com 4. Excel Tips and Tricks at http://exceldailytip.blogspot.com To post to this group, send email to excel-macros@googlegroups.com If you find any spam message in the group, please send an email to: Ayush Jain @ jainayus...@gmail.com or Ashish Jain @ 26may.1...@gmail.com <><><><><><><><><><><><><><><><><><><><><><> HELP US GROW !! We reach over 6,500 subscribers worldwide and receive many nice notes about the learning and support from the group. Our goal is to have 10,000 subscribers by the end of 2009. Let friends and co-workers know they can subscribe to group at http://groups.google.com/group/excel-macros/subscribe