Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I need a Macro to traspose values from a column in Sheet 1 to a row in Sheet
2. The column has 100 rows, I need to traspose from seven to seven. I did the part of the macro that traspose the values, but I don't know how to put this in a For or While Structure so as to count seven cells. This is what I did: Range("A2:A8").Select Selection.Copy Sheets("Sheet3").Select Range("B3").Select Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:= _ False, Transpose:=True Thanks in advance Regards Emece.- |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
hi
if i understand you, you have a column 100 values long and want to transpose it to to rows on sheet 2 in groups of 7. try this. let me know if it worked for you. Sub trans() Dim r As Range Dim rd As Range Dim ro As Range Dim rod As Range Dim rm As Range Dim lr As Long Dim c As Long lr = Cells(Rows.Count, "A").End(xlUp).Row Set r = Range("A2") Set ro = Sheets("sheet2").Range("b3") Set rm = Range("A2:A" & lr) c = 1 For Each cell In rm Set rd = r.Offset(1, 0) Set rod = ro.Offset(0, 1) ro.Value = r.Value c = c + 1 Set r = rd If c < 8 Then Set ro = rod Else Set ro = ro.Offset(1, -6) c = 1 End If Next cell End Sub works in xp. regards FSt1 "Emece" wrote: I need a Macro to traspose values from a column in Sheet 1 to a row in Sheet 2. The column has 100 rows, I need to traspose from seven to seven. I did the part of the macro that traspose the values, but I don't know how to put this in a For or While Structure so as to count seven cells. This is what I did: Range("A2:A8").Select Selection.Copy Sheets("Sheet3").Select Range("B3").Select Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:= _ False, Transpose:=True Thanks in advance Regards Emece.- |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
traspose data with formulas | Excel Worksheet Functions | |||
Macro to double values in a cell | Excel Worksheet Functions | |||
Retrieving Values from Cell with Macro | Setting up and Configuration of Excel | |||
Compiling macro based on cell values | Excel Discussion (Misc queries) | |||
traspose a row by links | Excel Worksheet Functions |