Macro transposing column to rows in step of 15 rows

bluetingle

New Member
Joined
Jan 3, 2018
Messages
3
I have a table with columns A-F and several thousand rows. I want to be able to easily transpose the the first rows (2-16) in column E as headings on a new page.
From the F Column i alse need to transpose the data in row 2-16 to the new page. i need to do this for the entire F column. Every 15 step is a new row on the new page. The data looks like this. The left field is Column E and the one to the right is Column F. I would appreciate any help with this.

AdressAndelsvägen 13
c/o
EfternamnKomaki
Epostx
FörnamnBirgitta
Har du erfarenhet av röstmottagning?Ja
Kan du arbeta heltid 22 aug - 9 sep?Ja
Mobiltelefonnummerx
Om ja, var och när?Stockholm innerstad olika valkretsar samt Akalla. Har varit med nästan alla val sedan 1973.
Övrigt (andra meriter)Önskemål Arbetar gärna nära Odenplan eller Centralen , åker med SL från Sollentuna.
Personnummer ååmmdd-xxxxx
Postnummer xxx xx19149
PostortSollentuna
Språkkunskaper utöver svenska och engelska
Telefonx
AdressNyponrosvägen, 5, 5
c/o
EfternamnBäckman
Epostx
FörnamnMarianne
Har du erfarenhet av röstmottagning?Ja
Kan du arbeta heltid 22 aug - 9 sep?Ja
Mobiltelefonnummerx
Om ja, var och när?alla val sedan jag var 20 år
Övrigt (andra meriter)alla va förtidsröstning och ordförande nu i sofia 2
Personnummer ååmmdd-xxxxx
Postnummer xxx xx13833
PostortÄlta
Språkkunskaper utöver svenska och engelskasvenska och engelska
Telefonx
AdressKungsgatan 51
c/o
EfternamnSagindykova

<tbody>
</tbody>
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
Re: Urgent help with macro transposing column to rows in step of 15 rows

please ask with a very simple pretend layout say 4 cols 10 rows and your desired output
 
Upvote 0
Re: Urgent help with macro transposing column to rows in step of 15 rows

This is the layout i'd like to achieve:

Adressc/oEfternamnEpostFörnamnHar du erfarenhet av röstmottagning?Kan du arbeta heltid 22 aug - 9 sep?MobiltelefonnummerOm ja, var och när?Övrigt (andra meriter)Personnummer ååmmdd-xxxxPostnummer xxx xxPostortSpråkkunskaper utöver svenska och engelskaTelefon
Andelsvägen 13Komakix@yBirgittaJaJaxxxxxStockholm innerstad olika valkretsar samt Akalla. Har varit med nästan alla val sedan 1973.Önskemål Arbetar gärna nära Odenplan eller Centralen , åker med SL från Sollentuna.xxxxxx19149Sollentunaxxxxx
Nyponrosvägen, 5, 5Bäckmany@xMarianneJaJaxxxxxalla val sedan jag var 20 åralla va förtidsröstning och ordförande nu i sofia 2xxxxx13833Ältasvenska och engelskaxxxxxx

<tbody>
</tbody>


So far this is what i have come up with but it doesn't really behave the way i want :D

Code:
Sub SCU()
    Dim Gen As Worksheet
    Dim Ink As Worksheet
    Dim i As Integer
    Dim z As Integer
    Dim x As Integer
    
    'Set Gen = Sheets("Generated")
    Set Ink = Sheets("inkomna")
    
    i = Cells(Rows.Count, "E").End(xlUp).Row
    z = 2: x = 1
    While z <= i
    Ink.Range("F2" & x).Resize(, 15) = _
            WorksheetFunction.Transpose(Range("F" & z).Resize(15))
        z = z + 15: x = x + 1
    Wend
End Sub
 
Upvote 0
Re: Urgent help with macro transposing column to rows in step of 15 rows

How about
Code:
Sub CopyTrans16()

   Dim Rw As Long
   Dim i As Long
   
   Rw = 2
   With Sheets("Sheet2")
      .Range("A1:O1").Value = Application.Transpose(Range("E2:E16"))
      For i = 2 To Range("F" & Rows.Count).End(xlUp).Row Step 15
         .Range("A" & Rw).Resize(, 15).Value = Application.Transpose(Range("F" & i).Resize(15))
         Rw = Rw + 1
      Next i
   End With
End Sub
The "Data" sheet needs to be the active sheet & this will copy to "Sheet2"
 
Upvote 0
Re: Urgent help with macro transposing column to rows in step of 15 rows

AdressAndelsvägen 13Adressc/oEfternamnEpostFörnamnHar du erfarenhet av röstmottagning?Kan du arbeta heltid 22 aug - 9 sep?MobiltelefonnummerOm ja, var och när?
c/oAndelsvägen 13KomakixBirgittaJaJaxStockholm innerstad olika valkretsar samt Akalla. Har varit med nästan alla val sedan 1973.
EfternamnKomakiAndelsvägen 14KomakiooxBirgittaxxxNeinJaxdifferent text
Epostx
FörnamnBirgitta
Har du erfarenhet av röstmottagning?Ja
Kan du arbeta heltid 22 aug - 9 sep?Jathis macro pulled the data into the table
Mobiltelefonnummerxjust adjust it for actual number of records = rows in a block of data
Om ja, var och när?Stockholm innerstad olika valkretsar samt Akalla. Har varit med nästan alla val sedan 1973.
AdressAndelsvägen 14Sub Macro4()
c/o '
EfternamnKomakioo' Macro4 Macro
Epostx' Macro recorded 27/02/2018 by bob
FörnamnBirgittaxxx'
Har du erfarenhet av röstmottagning?Nein
Kan du arbeta heltid 22 aug - 9 sep?Ja'
Mobiltelefonnummerx Sum = 0
Om ja, var och när?different text Count = -8
For t = 2 To 3
Count = Count + 9
For s = 4 To 12
Cells(t, s) = Cells((s - 3) + Sum, 2)
Next s
Sum = Sum + 9
Next t
End Sub

<colgroup><col><col><col><col><col><col><col><col><col span="3"><col></colgroup><tbody>
</tbody>
 
Upvote 0
Re: Urgent help with macro transposing column to rows in step of 15 rows

Thank you Fluff, you solved my problem. Deeply appreciated
 
Upvote 0
Re: Urgent help with macro transposing column to rows in step of 15 rows

Glad to help & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,214,979
Messages
6,122,552
Members
449,088
Latest member
davidcom

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top