ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Make stair columns (https://www.excelbanter.com/excel-discussion-misc-queries/56592-make-stair-columns.html)

[email protected]

Make stair columns
 
Hi..there
If you have any clue, please help me out.
I have the values in A column below
A
B
C
D
E
F
G
H
I
J
K
L
But I wold like to get:
A
B D
C E G
F H J
I K
L

Thank you.


Dave Peterson

Make stair columns
 
How about a macro:

Option Explicit
Sub testme()

Dim DestCell As Range
Dim myStep As Long
Dim LastRow As Long
Dim FirstRow As Long
Dim iRow As Long

myStep = 3

With Worksheets("sheet1")
FirstRow = 1
LastRow = .Cells(.Rows.Count, "A").End(xlUp).Row

Set DestCell = .Range("a1")
For iRow = FirstRow + myStep To LastRow Step myStep
Set DestCell = DestCell.Offset(1, 1)
With .Cells(iRow, "A").Resize(myStep)
.Copy _
Destination:=DestCell
.ClearContents
End With
Next iRow

End With

End Sub

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

wrote:

Hi..there
If you have any clue, please help me out.
I have the values in A column below
A
B
C
D
E
F
G
H
I
J
K
L
But I wold like to get:
A
B D
C E G
F H J
I K
L

Thank you.


--

Dave Peterson

Bryan Hessey

Make stair columns
 

My working columns are in the attached .xls, but it would take someone
with a little more expertise to make a simple one-column formula from
that.

Good luck, and if you cannot access the .zip file from
www.excelforum.com please let me know and I will email it to you.

Cheers


ps, hi Dave

Wrote:
Hi..there
If you have any clue, please help me out.
I have the values in A column below
A
B
C
D
E
F
G
H
I
J
K
L
But I wold like to get:
A
B D
C E G
F H J
I K
L

Thank you.



+-------------------------------------------------------------------+
|Filename: pyramid.zip |
|Download:
http://www.excelforum.com/attachment.php?postid=4052 |
+-------------------------------------------------------------------+

--
Bryan Hessey
------------------------------------------------------------------------
Bryan Hessey's Profile: http://www.excelforum.com/member.php...o&userid=21059
View this thread: http://www.excelforum.com/showthread...hreadid=487020


[email protected]

Make stair columns
 
It works nicely.
I really appreciate it.
Jae Ryu


[email protected]

Make stair columns
 
Hi Bryan:
I coudn't get pyramid.zip file you attached.
The webserver said the line is invalid.
If you send me the file, it would be great.
Thanks.
Jae Ryu



All times are GMT +1. The time now is 12:42 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com