Hello to all of you.
I am new to forum and I hope that my post will be okay.
I have a workbook that contains 13 worksheets. The first sheet's name is T1 and contains data at 13 rows and 45 columns starting from D19.Next sheet's name is T2 and so on until to T13.
I wrote a macro that I want to transpose and paste link from sheet T1 to the other sheets by this way:
D19:L19 sheet T1 to B2:B10 sheet T2.
M19:U19 sheet T1 to C2:C10 sheet T2.
V19:AD19 sheet T1 to D2:D10 sheet T2.
AE19:AM19 sheet T1 to E2:E10 sheet T2.
AN19:AV19 sheet T1 to F2:F10 sheet T2.
Also the same thing for row 20 from sheet T1 to sheet T3, row 21 from sheet T1 to sheet T4 and etc.
The macro is the following:
My problem is that for i=2 I can't find a way to change D19 to D20 , L19 to L20 and so on.
I hope that I explained my problem clearly. I ask if there is a way to change my macro or if there is a better macro to do this. Thanks for your help.
I am new to forum and I hope that my post will be okay.
I have a workbook that contains 13 worksheets. The first sheet's name is T1 and contains data at 13 rows and 45 columns starting from D19.Next sheet's name is T2 and so on until to T13.
I wrote a macro that I want to transpose and paste link from sheet T1 to the other sheets by this way:
D19:L19 sheet T1 to B2:B10 sheet T2.
M19:U19 sheet T1 to C2:C10 sheet T2.
V19:AD19 sheet T1 to D2:D10 sheet T2.
AE19:AM19 sheet T1 to E2:E10 sheet T2.
AN19:AV19 sheet T1 to F2:F10 sheet T2.
Also the same thing for row 20 from sheet T1 to sheet T3, row 21 from sheet T1 to sheet T4 and etc.
The macro is the following:
Code:
Sub b()
Dim i As Integer
Sheets("T2").Select
For i = 1 To 12
Range("B2:B10").Select
Selection.FormulaArray = "=TRANSPOSE(T1!D19: L19)"
Range("C2:C10").Select
Selection.FormulaArray = "=TRANSPOSE(T1!M19:U19)"
Range("D2:D10").Select
Selection.FormulaArray = "=TRANSPOSE(T1!V19:AD19)"
Range("E2:E10").Select
Selection.FormulaArray = "=TRANSPOSE(T1!AE19:AM19)"
Range("F2:F10").Select
Selection.FormulaArray = "=TRANSPOSE(T1!AN19:AV19)"
ActiveWindow.DisplayZeros = False
ActiveSheet.Next.Select
Next i
End Sub
I hope that I explained my problem clearly. I ask if there is a way to change my macro or if there is a better macro to do this. Thanks for your help.