+ Reply to Thread
Results 1 to 5 of 5

Copy Paste Macro based on Columns And Rows - Horizontal to Veritcal

  1. #1
    Registered User
    Join Date
    06-30-2015
    Location
    Toronto, Canada
    MS-Off Ver
    2010
    Posts
    52

    Copy Paste Macro based on Columns And Rows - Horizontal to Veritcal

    I currently have a spreadsheet from which I'm using to organize my data. It's currently structured in the following format:

    Column A
    1
    2
    3

    Column C-F is 'wrap text' and below it are the following headings A,B,C,D
    Column G-H is 'wrap text' and below it are also the following headings A, B, C, D

    What I'm trying to accomplish is the following:

    copy all the fields in another spreadsheet Column A row one from C-F and G-H in another sheet in a vertical order if column C is year 2017.

    This sounds confusing but I've attached a sample sheet. Currently, I'm doing this manually by row and it's taking a long time.

    Sample attached
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    06-30-2015
    Location
    Toronto, Canada
    MS-Off Ver
    2010
    Posts
    52

    Re: Copy Paste Macro based on Columns And Rows - Horizontal to Veritcal

    Let me know if anything else is required - fairly new to VBA

  3. #3
    Administrator JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Copy Paste Macro based on Columns And Rows - Horizontal to Veritcal

    NOTE: If I hadn't already been working on your question, your "bump" would have made your question invisible to me. I use the UNANSWERED THREADS link above in the menu options to find questions with no replies. So resist bumping like that here on this forum.

    Here's my solution. The macro checks the active sheet to make sure cell B1 says "Project 1", if it does, it asks you for the Max Year to include, then extract all the data to a new sheet.

    Please Login or Register  to view this content.
    Attached Files Attached Files
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  4. #4
    Registered User
    Join Date
    06-30-2015
    Location
    Toronto, Canada
    MS-Off Ver
    2010
    Posts
    52

    Re: Copy Paste Macro based on Columns And Rows - Horizontal to Veritcal

    this is great - thank you so much Mr. MVP.

    Quick question is there a way to insure we don't capture blanks or zero values? Seeing a lot of blank rows

  5. #5
    Administrator JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Copy Paste Macro based on Columns And Rows - Horizontal to Veritcal

    Can you show me your undesired result? Your example included blank rows between each group, so that was programmed in as well.

+ 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. Copy paste based on rows/columns filled
    By bsturds in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-11-2015, 10:27 AM
  2. Macro to copy rows based on moving date and paste the rows into an identical sheet
    By ivandc1234 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-28-2014, 11:59 AM
  3. Compare two sheets,copy and paste unique rows based on values in 2 columns
    By ooggiemobile in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-02-2013, 03:58 AM
  4. Macro to COPY and PASTE VALUES for in columns based on the date
    By tompee29 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-05-2012, 10:54 AM
  5. Replies: 0
    Last Post: 09-13-2012, 04:47 PM
  6. Macro to copy paste columns to specific rows
    By ohjeez in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-31-2011, 12:08 PM
  7. [SOLVED] Macro to copy and paste rows to a new sheet based on criteria
    By Belo in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-31-2010, 02:25 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