+ Reply to Thread
Results 1 to 8 of 8

How to copy a vertical range of data horizontally after nine successive columns in a row?

  1. #1
    Forum Contributor
    Join Date
    02-16-2017
    Location
    Bangladesh
    MS-Off Ver
    2021
    Posts
    196

    How to copy a vertical range of data horizontally after nine successive columns in a row?

    I have three sheets in my workbook named "Range", "Plan", and "Print".
    If "1st Range" is selected in "Print!C6" cell of "Print" sheet, then "Range!C7:F7" data of "Range!C6:V150" range is copied and pasted in "Plan!A7:D7" range of "Plan" sheet.
    In this way, after nine columns, "Range!C8:F8" data should be copied and pasted in the "Plan!J7:M7" range of the "Plan" sheet. In this way, nine consecutive columns of "Range!C7:F150" vertical data should be pasted in the "Plan" sheet.
    Also, filter the non-blank rows of the "Range!G7:V7" range of the "Range" sheet and paste the data corresponding to the "Range!G6:V6" range into the "Plan!A8:I9" range of the "Plan" sheet. In this way, nine consecutive columns should be pasted in the "Plan" sheet next to the "Range" sheet.
    Thus, if "1st Range" is selected in "Print!C6" cell of "Print" sheet, then "Range!C6:V150" should be used.
    And if "2nd Range" is selected in "Print!C6" cell of "Print" sheet, then "Range!AB6:AU150" must be used.
    And if "3rd range" is selected in "Print!C6" cell of "Print" sheet, then "Range!BA6:BT150" should be used.
    Last edited by Ariful Islam; 03-31-2023 at 07:27 AM.

  2. #2
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,209

    Re: How to copy a vertical range of data horizontally after nine successively columns in a

    What happens when we get to G12 of "Range" as we have a new heading "6/CT" ???
    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

  3. #3
    Forum Contributor
    Join Date
    02-16-2017
    Location
    Bangladesh
    MS-Off Ver
    2021
    Posts
    196

    Re: How to copy a vertical range of data horizontally after nine successively columns in a

    Quote Originally Posted by JohnTopley View Post
    What happens when we get to G12 of "Range" as we have a new heading "6/CT" ???
    The data of "G12" will be copied to page 6 of the "Plan" sheet. The new heading will be –

    6/CT 6/ET 6/PT
    24 36 12
    Attached Images Attached Images
    Last edited by Ariful Islam; 03-31-2023 at 12:17 PM.

  4. #4
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,209

    Re: How to copy a vertical range of data horizontally after nine successively columns in a

    Please Login or Register  to view this content.
    Last edited by JohnTopley; 04-01-2023 at 01:47 AM.

  5. #5
    Forum Contributor
    Join Date
    02-16-2017
    Location
    Bangladesh
    MS-Off Ver
    2021
    Posts
    196

    Re: How to copy a vertical range of data horizontally after nine successively columns in a

    I sincerely apologize for the late response. I am thankful to you for taking so much time to give a perfect solution to such a complicated matter.
    Anyway your code is working very well. But there is a small error. For example "4th Range" and "5th Range" are showing output even though there is no data, which is not desired. Will you take a look at this?
    Also I don't know, does the "module-2" you provided have any effect on the output?
    Please Login or Register  to view this content.
    Last edited by Ariful Islam; 04-01-2023 at 03:49 AM.

  6. #6
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,209

    Re: How to copy a vertical range of data horizontally after nine successively columns in a

    Please Login or Register  to view this content.

  7. #7
    Forum Contributor
    Join Date
    02-16-2017
    Location
    Bangladesh
    MS-Off Ver
    2021
    Posts
    196

    Re: How to copy a vertical range of data horizontally after nine successively columns in a

    It is working great. Your code solved a problem I had been struggling with for quite some time, and I am truly grateful for your assistance. Your kindness and generosity in taking the time to help me with my issue is greatly appreciated. Your assistance has made a significant difference in my work, and I will always remember your kindness. Thanks once again.

  8. #8
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,209

    Re: How to copy a vertical range of data horizontally after nine successively columns in a

    You/re very welcome and thank you for the rep.

+ 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. [SOLVED] Drag Formula Horizontally With Vertical Reference (With Skipping Columns)
    By Saradomin in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 03-12-2022, 06:53 AM
  2. [SOLVED] Drag horizontally and copy vertical cells
    By shamskh2 in forum Excel Formulas & Functions
    Replies: 18
    Last Post: 04-11-2020, 12:33 PM
  3. [SOLVED] how to sum horizontally where sum range is horizontal and criteria are in vertical range?
    By sagarkarki69 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-01-2020, 11:50 AM
  4. Trying to copy data from sheet1 vertical to sheet3 horizontally
    By UltimateNeo in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-05-2019, 01:33 AM
  5. Replies: 1
    Last Post: 01-16-2012, 11:31 PM
  6. tranpose vertical data horizontally
    By southstar99 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-17-2009, 01:45 PM
  7. Mirroring vertical data horizontally.
    By DawnGL in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 08-20-2008, 11:04 AM

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