+ Reply to Thread
Results 1 to 7 of 7

Copy cells based on another cell's value

  1. #1
    Registered User
    Join Date
    04-28-2014
    Location
    Sverige
    MS-Off Ver
    Excel 2007
    Posts
    17

    Copy cells based on another cell's value

    Hi,

    I'm new to VBA and still can't figure out how to solve this problem.

    I have three tabs called DATA, NEW and OLD. The DATA! tab contains a data set out of which want to copy cell values based on the value column P. The NEW and OLD tabs are identical apart from cell B4, which contains the number that should be compared to the value in DATA!P.

    If DATA!P5 = NEW!$B$4 I want cell values DATA!A5:N5 to be copied to NEW!A5:N5. If the value in the DATA!P5 equal the value in OLD!$B$4, then DATA!A5:N5 should be copied to the OLD! tab instead.

    I apologize for the confussing description and thanks in advance for all potential help.

    Best,
    Alex

  2. #2
    Registered User
    Join Date
    02-20-2014
    Location
    Wales
    MS-Off Ver
    Excel 2010
    Posts
    87

    Re: Copy cells based on another cell's value

    Can you attach your spreadsheet so that we can understand the problem better?

  3. #3
    Registered User
    Join Date
    04-28-2014
    Location
    Sverige
    MS-Off Ver
    Excel 2007
    Posts
    17

    Re: Copy cells based on another cell's value

    I have attached a file. Thanks for the help.
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    02-20-2014
    Location
    Wales
    MS-Off Ver
    Excel 2010
    Posts
    87

    Re: Copy cells based on another cell's value

    Hi,

    This code will work for copying to your OLD tab - put a button on your DATA tab and add:

    Please Login or Register  to view this content.
    Adjust the references for OLD to NEW and add to another button on your DATA tab for the NEW option

  5. #5
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Copy cells based on another cell's value

    Maybe:

    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    04-28-2014
    Location
    Sverige
    MS-Off Ver
    Excel 2007
    Posts
    17

    Re: Copy cells based on another cell's value

    Thanks a lot for your help guys, it's really appreciated.

  7. #7
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Copy cells based on another cell's value

    You're welcome. Glad to help out.

+ 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] copy cells based on cell value
    By Ctomo in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-10-2014, 05:06 AM
  2. [SOLVED] copy cell values in one cell based on value of adjacent cells
    By KK1234 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-20-2014, 08:48 AM
  3. [SOLVED] Copy cells based on value of another cell
    By shart2k12 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-21-2013, 05:11 AM
  4. [SOLVED] Copy cells based on another cell
    By shronk in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 07-03-2013, 01:19 PM
  5. Need to copy certain cells based on an entry in another cell
    By loser420 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-11-2013, 10:24 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