View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Martin Fishlock[_3_] Martin Fishlock[_3_] is offline
external usenet poster
 
Posts: 59
Default Changing a matrix into one large column

Try:

Option Explicit

Sub Matrix()
Dim wss As Worksheet
Dim wsd As Worksheet
Dim rs As Long ' row src
Dim cs As Long ' col src
Dim rd As Long ' row dest

Set wss = ActiveSheet
Set wsd = ActiveWorkbook.Worksheets.Add ' make new sheet
rs = 1
cs = 1
rd = 1

'assume starts in A1
While wss.Cells(rs, 1) < ""
While wss.Cells(rs, cs) < ""
wsd.Cells(rd, 1) = wss.Cells(rs, cs)
rd = rd + 1
cs = cs + 1
Wend
rs = rs + 1
cs = 1
Wend
Set wss = Nothing
Set wsd = Nothing
End Sub

--
HTHs Martin


"jeroen2" wrote:


Hi,

Does anyone know how to change a large matrix into one column?

Like this:

abc
abc
abc

into

a
a
a
b
b
b
c
c
c

I am not being to able to solve this puzzle

Jeroen


--
jeroen2
------------------------------------------------------------------------
jeroen2's Profile: http://www.excelforum.com/member.php...o&userid=30863
View this thread: http://www.excelforum.com/showthread...hreadid=505353