Code to tranpose table

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Please help me with vb or macros to tranpose Table 1 to Table 2 for any
number of entries. The courses in a row should be made into only one course
in a row as shown in Table 2.

Table 1
Trainer Room 25-Jun-05 26-Jun-05 27-Jun-05 28-Jun-05 29-Jun-05
Trainer1 Room1 CSB00 CSB00 CSB00
Trainer2 Room2 CSB01 CSB01

Table 2
Trainer Room 25-Jun-05 26-Jun-05 27-Jun-05 28-Jun-05 29-Jun-05
Trainer1 Room1 CSB00
Trainer1 Room1 CSB00
Trainer1 Room1 CSB00
Trainer2 Room2 CSB01
Trainer2 Room2 CSB01
 
I don't think this is exactly what you need, but it'll help

Sub Macro8()
Range("M1:P7").Select 'What to copy
Selection.Copy
Range("Q2").Select 'Where to paste it
Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone,
SkipBlanks:= _
False, Transpose:=True
End Sub
 
Back
Top