Hi. I am very new to VBA code and this loop crashed Excel several times for me.
I am attempting to transpose data from the range D2:K2 (which is in rows) in the "GoogleFormData" sheet to cell E22 in the "TheModel" sheet until it reaches a cell range Di:Kj with no data.
Right now, the data looks like this (this is data in columns D through K in the "GoogleFormData" sheet):
And I would like it to look like this (this is data is in column E in the "TheModel" sheet starting with E22 as the top cell):
This is the code I have attempted below.
I am attempting to transpose data from the range D2:K2 (which is in rows) in the "GoogleFormData" sheet to cell E22 in the "TheModel" sheet until it reaches a cell range Di:Kj with no data.
Right now, the data looks like this (this is data in columns D through K in the "GoogleFormData" sheet):
And I would like it to look like this (this is data is in column E in the "TheModel" sheet starting with E22 as the top cell):
This is the code I have attempted below.
VBA Code:
Sub TransposeModules()
Dim i As Integer
Dim j As Integer
Dim k As Integer
i = 1
j = 1
k = 14
Do Until IsEmpty(Worksheets("GoogleFormData").Range("D" & i & ":K" & j))
i = i + 1
j = j + 1
k = k + 8
Sheets("GoogleFormData").Select
Range("D" & i & ":K" & j).Select
Selection.Copy
Sheets("TheModel").Select
Range("E" & k).Select
Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=True
Loop
End Sub