Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copy Cells from columns to rows
I need A1:A3 then A4:A6 then A7:A8 copied to Row ?(1,3), row ? (1,3), row ? (1,3) depending on the row heading, then delete cell color and Print sheet: Can anyone help with some generic code for me Please!!! ie.
A1 A2 2. A3 $1.5 A4 A5 A6 $3.0 A7 A8 A9 $4.5 Family Type Pounds Pric C A 2.5 $1.5 P B 2 $3.0 M C 4 $4.50 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copy Cells from columns to rows
Sub Test() Dim v v = ListToTable([a1].currentregion, 3) [a1].currentregion.clear [a1].Resize(UBound(v, 1), UBound(v, 2)) = v End Sub Function ListToTable(oriTable As Range, numFields As Integer) Dim newTable As Variant, r As Long, c As Integer ReDim newTable(1 To (1 + oriTable.Rows.Count \ numFields), 1 To numFields) For r = 1 To oriTable.Rows.Count Step numFields For c = 1 To numFields newTable(1 + r \ numFields, c) = oriTable(r + c - 1, 1) Next Next ListToTable = newTable End Function keepITcool < email : keepitcool chello nl (with @ and .) < homepage: http://members.chello.nl/keepitcool "?B?U2tpcGM=?=" wrote: I need A1:A3 then A4:A6 then A7:A8 copied to Row ?(1,3), row ? (1,3), row ? (1,3) depending on the row heading, then delete cell color and Print sheet: Can anyone help with some generic code for me Please!!! ie. A1 A A2 2.5 A3 $1.50 A4 B A5 2 A6 $3.00 A7 C A8 4 A9 $4.50 Family Type Pounds Price C A 2.5 $1.50 P B 2 $3.00 M C 4 $4.50 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copy Cells from columns to rows
Thanks Keep: I left out that this has to happen from sheet1 into sheet2 sorry. Where would that go in the code
SkipC |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copy Cells from columns to rows
well... i did put it in a function... try: Sub Test2() Dim v v = ListToTable([sheet1!a1].currentregion, 3) [sheet2!a1].Resize(UBound(v, 1), UBound(v, 2)) = v End Sub keepITcool < email : keepitcool chello nl (with @ and .) < homepage: http://members.chello.nl/keepitcool "?B?U2tpcGM=?=" wrote: Thanks Keep: I left out that this has to happen from sheet1 into sheet2 sorry. Where would that go in the code? SkipC |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copy Cells from columns to rows
Thanks Cool: Yoou've been a great help
Skipc |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Can't Copy/Cut Cells, Rows or Columns | Excel Discussion (Misc queries) | |||
copy cells from columns to rows | Excel Discussion (Misc queries) | |||
copy formulas to cells absolute rows and variable columns | Excel Discussion (Misc queries) | |||
Copy Data to Rows instead of Columns | Excel Programming | |||
Copy Data to Rows instead of Columns | Excel Programming |