Rayne
asked on
Tranpose With Spaces
Hello All,
I have got the code that does this so far – transpose column to a single row of dates. But I have a spacing thing. Need three months followed by a empty cell. For example >>
The transposed numbers need to be in this way – after the first three months, there is a empty cell, then followed by the next three months and an empty cell.
Prior Related Question: http:Q_27827545.html
tranposeAtSpaces.xlsm
spacesHow.png
I have got the code that does this so far – transpose column to a single row of dates. But I have a spacing thing. Need three months followed by a empty cell. For example >>
The transposed numbers need to be in this way – after the first three months, there is a empty cell, then followed by the next three months and an empty cell.
Prior Related Question: http:Q_27827545.html
tranposeAtSpaces.xlsm
spacesHow.png
This works
For i = LBound(X) To UBound(X)
If LnCnt = 3 Then
Ad = Ad + 1
LnCnt = 0
End If
rng.Cells(i + Ad).Value = X(i, 1)
LnCnt = LnCnt + 1
Next
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hello Everyone :)
Dragontooth thank you for your code. I noticed when I call the macro, i get a last three months on the next line, instead of the same line as other months. I am not sure why thats doing it. See image attached.
Aikimark - Sure, Please go ahead and make the suggestions as you indicated. I will go with the best practices as much has possible
Thank you all
Respectfully,
R
tranposeNextLine.png
Dragontooth thank you for your code. I noticed when I call the macro, i get a last three months on the next line, instead of the same line as other months. I am not sure why thats doing it. See image attached.
Aikimark - Sure, Please go ahead and make the suggestions as you indicated. I will go with the best practices as much has possible
Thank you all
Respectfully,
R
tranposeNextLine.png
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you both for the efforts. This got moving finally. Greatly appreciate your help on this.
Respect
R
Respect
R
ASKER
For i = LBound(X) To UBound(X)
If i = 4 Or i = 8 Or i = 12 Then
rng.Cells(i).Offset(, 1).Value = X(i, 1)
i = i + 1
Else
rng.Cells(i).Value = X(i, 1)
End If
Next
I am still not getting it