+ Reply to Thread
Results 1 to 2 of 2

Macro to copy a range of cells to another location based on odd or even number in a cell

Hybrid View

  1. #1
    Registered User
    Join Date
    05-12-2013
    Location
    Beaver, Pa
    MS-Off Ver
    Excel 2007
    Posts
    25

    Macro to copy a range of cells to another location based on odd or even number in a cell

    I want a macro to copy a range on sheet 1 to another location on sheet 1 based on whether a separate cell has an odd or even number in it. Number can be variable from 2 to 13.
    DataRange contains names. Cell with odd or even number D8. Range of cells to copy(DataRange)= K3:L15. Copy to (PasteRange)= K37:L49. If 'Even' number - reverse order paste ( K15 and L15 would end up at K37 and L37 and so on until K3,L3 were at K49,L49). If 'Odd' number - Reverse order paste as above, but also compare PasteRange K37:L49 with DataRange of K3:L15. When row (i) found that matches all 4 names, move K(i) and L(i) to first row if L(i) is blank and last row if L(i) is not blank.

    I have tried several different attempts at this and ask for help on other occasions, but my lack of Excel experience and experience with Forums have created more problems than answers. I've drawn this out on paper and it should work, but the programming is beyond my ability. Any Help????

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Macro to copy a range of cells to another location based on odd or even number in a ce

    Hi,

    I think an example workbook is called for. Show a before and after situation, and add narrative notes which contain references to specific cell ranges that explain the results you've arrived at.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

+ 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. Replies: 3
    Last Post: 08-15-2013, 01:22 PM
  2. Copy rows to another worksheet based on location of empty cells
    By matthewnelson85 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-20-2012, 11:18 AM
  3. [SOLVED] Copy data from a range of cells into a blank range based on common cell
    By vanmeterkj in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-03-2012, 10:18 AM
  4. [SOLVED] Excel VBA/Macro - Copy Number of Rows based on the number in a cell to another sheet
    By diane.alexander58 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-15-2012, 11:32 AM
  5. Macro Problem, copy range of cells based on criteria
    By Ang12345 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-22-2010, 05:10 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