1

I have a balanced (no gaps or blanks) data that looks like this:

year var1 var2
2000  1    8
2001  2    9
2003  3    10  
2004  4    11
2005  5    12 
2006  6    13

I am trying to arrange the data in such a way that var2 column, from row 2 onwards, is pasted in 21st row, column D. I then want var3 pasted in column D after the var2. I want to repeat this for 242 variables. I also want the year values to repeat. Finally, my data should look something like this (I have done the exercise for the var2 only):

year var1 
2000  1    
2001  2    
2002  3    
2003  4    
2004  5    
2005  6 
2000  8
2001  9
2002  10
2003  11
2004  12
2005  13

I have tried using macros but got nothing but errors. The problem lies in identifying where the last filled row and then pasting the remaining data below it and then looping this over. I can understand and implement python code as well, if the solution is in pyhton.

braX
  • 11,506
  • 5
  • 20
  • 33
badavadapav
  • 89
  • 2
  • 13
  • kindly post sample data, not pics – sammywemmy Mar 29 '20 at 08:34
  • @jezrael i don't think the OP wants rows with melt. It's more a case of "add X number of columns under the existing second column and replicate down the existing values as needed in the first column" – MDR Mar 29 '20 at 11:12

0 Answers0