+ Reply to Thread
Results 1 to 9 of 9

Macro to copy and paste (transpose) data from column to row - How to automate values

  1. #1
    Registered User
    Join Date
    09-10-2019
    Location
    kent
    MS-Off Ver
    2016
    Posts
    12

    Macro to copy and paste (transpose) data from column to row - How to automate values

    I have managed to create a macro which would allow me to copy and paste an specific number of values from a column and then transpose those values into a specific row on a spreadsheet.

    here is the code..

    Please Login or Register  to view this content.
    the problem is that this code only works up to certain number of rows... up till H13 for example, but if I want to this repeat this process up to row H600 (range of H600:H605) and pasting to I20 for example
    without copying and pasting this code hundreds of times, is there a way I can do this?

    Thanks for the responses.
    Last edited by davesexcel; 09-13-2019 at 09:30 AM.

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,525

    Re: Macro to copy and paste (transpose) data from column to row - How to automate values

    try this out,

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    09-10-2019
    Location
    kent
    MS-Off Ver
    2016
    Posts
    12

    Re: Macro to copy and paste (transpose) data from column to row - How to automate values

    thanks for your code, I have tried it but it has given me the data fully transposed, from column I like this (given me 6 extra columns)
    Attachment 641303

    while I want the data transposed into only 2 columns like this and in order of the copy and pasting..

    Attachment 641304

    Anyway I can make alternations to the code to make look like this?

  4. #4
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,525

    Re: Macro to copy and paste (transpose) data from column to row - How to automate values

    That's fine, I only supplied you with a code with the information you provided.

  5. #5
    Registered User
    Join Date
    09-10-2019
    Location
    kent
    MS-Off Ver
    2016
    Posts
    12

    Re: Macro to copy and paste (transpose) data from column to row - How to automate values

    Ok any idea where I can alter the code to make the transposed data appear in only 2 columns,

    like this?
    Attached Images Attached Images

  6. #6
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,525

    Re: Macro to copy and paste (transpose) data from column to row - How to automate values

    Hard to see the logic, possibly supply a sample workbook

  7. #7
    Registered User
    Join Date
    09-10-2019
    Location
    kent
    MS-Off Ver
    2016
    Posts
    12

    Re: Macro to copy and paste (transpose) data from column to row - How to automate values

    Okay here is the sample workbook on sheet 1.

    Columns I and J shows how I want the data to be displayed.

    The data is originally copied and transposed from column H.

    So in the future any data that is input into column H would then be transposed in order into columns I and J.
    Attached Files Attached Files

  8. #8
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Cool Try this ‼


    Quote Originally Posted by shevchenko2020 View Post
    So in the future any data that is input into column H would then be transposed in order into columns I and J.
    According to your attachment an already working event code to paste to the (Sheet1) worksheet module :

    PHP Code: 
    Private Sub Worksheet_Change(ByVal Target As Range)
        If 
    Target.CountLarge And Target.Column And Target.Row 1 Then
            Application
    .EnableEvents False
            Cells
    (Target.Row 2+ (Target.Row And 1)).Value2 Target.Value2
            Application
    .EnableEvents True
        End 
    If
    End Sub 
    Do you like it ? So thanks to click on bottom left star icon « Add Reputation » !

  9. #9
    Registered User
    Join Date
    09-10-2019
    Location
    kent
    MS-Off Ver
    2016
    Posts
    12

    Re: Macro to copy and paste (transpose) data from column to row - How to automate values

    Thanks for the code but Iam still struck

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. I need a Macro script to copy a column, delete the additional rows and paste as transpose
    By mastersaanvi in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-16-2018, 02:05 AM
  2. Replies: 5
    Last Post: 11-17-2014, 02:40 PM
  3. [SOLVED] Macro to find SKU in column; then copy data in row and paste special (values)
    By Starkey in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 09-13-2012, 06:05 AM
  4. VB Macro to automate copy and paste of data in cells.
    By haleakala17 in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 08-20-2012, 10:06 PM
  5. Macro to copy and paste special values for column data and filter column data
    By ascottbag in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 03-10-2012, 02:15 PM
  6. Macro for copy paste values transpose
    By straggleyway in forum Excel General
    Replies: 0
    Last Post: 03-11-2009, 07:32 AM
  7. [SOLVED] HELP....Is there a way to automate copy/paste special/transpose -
    By Mel in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 03-28-2005, 07:06 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1