+ Reply to Thread
Results 1 to 2 of 2

Need a macro to copy 2 cells in an even numbered row to an odd numbered row

Hybrid View

  1. #1
    Registered User
    Join Date
    01-22-2014
    Location
    north dakota
    MS-Off Ver
    Excel 2010
    Posts
    1

    Need a macro to copy 2 cells in an even numbered row to an odd numbered row

    I have been trying to find or create a macro that will allow me to take information from Cells 80A and 80B and put them in 81A and 81B and then do that all the way down to 2624. I need to keep taking the information from the even numbered row in cells A & B and transfer it to the next row. All the even numbered rows have different information and I just want to copy that into the odd rows.
    Example
    Column A Column B
    80 864 dog
    81 864 dog
    82 872 cat
    83 872 cat

    The above is what I want it to show. Please help me. Thanks.

  2. #2
    Valued Forum Contributor
    Join Date
    01-19-2010
    Location
    Melbourne Australia
    MS-Off Ver
    latest is Excel 2016. have older versions
    Posts
    624

    Re: Need a macro to copy 2 cells in an even numbered row to an odd numbered row

    hello shadowamc and welcome to the forums

    you might like to try

    Dim current_row As Long
    Dim start_row As Long
    Dim end_row As Long
    
    start_row = 80
    end_row = 2624
    
    For current_row = start_row To end_row Step 2
        Cells(current_row + 1, 1) = Cells(current_row, 1)
        Cells(current_row + 1, 2) = Cells(current_row, 2)
    Next current_row
    jmac

+ 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] Macro to Merge Sequential Numbered Sheets
    By lesoies in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 12-06-2012, 08:12 AM
  2. Average of the last 3 numbered cells
    By Rikuk in forum Excel General
    Replies: 8
    Last Post: 08-05-2008, 12:20 PM
  3. Graphing only even/odd numbered cells
    By gantzlia in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 01-03-2006, 08:10 AM
  4. [SOLVED] how to write macro that filters odd & even numbered data ?
    By banu in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-11-2005, 02:05 AM
  5. [SOLVED] How do I get the sum of only odd/even numbered cells in a column?
    By Steve E in forum Excel General
    Replies: 3
    Last Post: 03-03-2005, 01: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