Posted to microsoft.public.excel.misc
|
|
How to copy some text in columns and rest in rows
Sub DBprep()
Worksheets(1).Select
j = 1
For i = 2 To 4
Worksheets(1).Select
s = Cells(i, 1).Text
c = Cells(i, 2).Value
d = Cells(i, 3).Value
p = Cells(i, 4).Value
t = Cells(i, 5).Value
s2 = Cells(i, 6).Value
Worksheets(2).Select
j = j + 1
Cells(j, 1).Value = s
Cells(j, 2).Value = c
Cells(j, 3).Value = d
Cells(j, 4).Value = p
j = j + 1
Cells(j, 1).Value = s
Cells(j, 2).Value = c
Cells(j, 3).Value = d
Cells(j, 4).Value = t
j = j + 1
Cells(j, 1).Value = s
Cells(j, 2).Value = c
Cells(j, 3).Value = d
Cells(j, 4).Value = s2
Next
End Sub
--
raypayette
------------------------------------------------------------------------
raypayette's Profile: http://www.excelforum.com/member.php...o&userid=29569
View this thread: http://www.excelforum.com/showthread...hreadid=573651
|