Good day all
I have a table that contains data of teachers timetables. Columns - Monday to Friday, rows are the periods of teaching. Each teacher's TT is below the next so separated by a blank row.
I want to create sheets for Monday to Friday and then copy each teacher's Monday, Tuesday, Wednesday etc to the relevant sheet and transpose it. Each teacher in a new row.
With some help of friends and a lot of googling I have gotten to this point, but this just transposes everything into one row as I initially thought each teacher's TT started every 16th row, but soon realised with merged cells this isn't the case.
I'm stuck.
I have a table that contains data of teachers timetables. Columns - Monday to Friday, rows are the periods of teaching. Each teacher's TT is below the next so separated by a blank row.
I want to create sheets for Monday to Friday and then copy each teacher's Monday, Tuesday, Wednesday etc to the relevant sheet and transpose it. Each teacher in a new row.
With some help of friends and a lot of googling I have gotten to this point, but this just transposes everything into one row as I initially thought each teacher's TT started every 16th row, but soon realised with merged cells this isn't the case.
I'm stuck.
VBA Code:
Sub TransposeData()
Dim rngDst As Range
Dim rngSrc As Range
' set reference to source range
Set rngSrc = Range("D2:E16")
' set reference to destination range
Set rngDst = Sheets("Tuesday").Range("B2")
Do
rngSrc.Copy
rngDst.PasteSpecial Transpose:=True
Set rngDst = rngDst.Offset(1)
Set rngSrc = rngSrc.Offset(15)
Loop Until rngSrc.Cells(1, 1).Value = ""
End Sub