+ Reply to Thread
Results 1 to 7 of 7

Copying a Column based on List Value

  1. #1
    Registered User
    Join Date
    05-16-2015
    Location
    UK
    MS-Off Ver
    2013
    Posts
    7

    Copying a Column based on List Value

    Hello I was wondering if you could help.

    I am trying to copy the values in two columns based on the value selected from a list.

    For example, when day of the month is selected in 'Daily Planner' in cell B2, I would like it to copy both columns from 'Edit This One' that correspond with that day of the month (when 3 is selected it copies columns I and J and pastes it it in Daily Planner Columns B and C). I have attached an example of my spreadsheet.

    I have tried all sorts but not that confident with VBA and Macros and I've been unable to get my head around the other examples on the net.

    Any help would be greatly appreciated.

    Thanks
    Attached Files Attached Files

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Copying a Column based on List Value

    You may (or may not) be OK with a formula-based solution. One thing is for sure, your description (in your post) and your sheet layout (the attached file) didn't seem compatible; so I really don't know what output you want. If this is NOT what you want, please reattach your sheet showing EXACTLY what you desired result should look like.

    I used this formula (after de-merging one totally un-needed merged cell (cell B2/C2) - don't merge cells widen them, deepen them - do anything, but don't merge them!!!.. they're the work of satan.

    =INDEX('Edit this one'!$C$5:$BL$7,MATCH('Daily Planner'!$A5,'Edit this one'!$A$5:$A$7,0),MATCH('Daily Planner'!$B$2:$B$2,'Edit this one'!$C$3:$BL$3,0))
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

  3. #3
    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: Copying a Column based on List Value

    Hi,

    Your data layout does not easily lend itself to analysis and you are mixing up the two elements of data capture and final reporting. The two require quite different treatments.

    A lot of people start by designing the form that they expect to see as the final report, and then wonder why it's so difficult to subsequently analyse and summarise or extract information from it, your layout is one such case.


    You should always capture data in a simple two dimensional table and worry about reporting information from it afterwards. Without exception doing this you will always be able to easily obtain management information. Rarely is this the case if you start the other way round.
    You will also throw open the whole wonderful world of the powerful Pivot table functionality. You are also committing the sin of merging cells. Most of us avoid these like the plague since they just cause too many problems for reasons that needn't concern us at the moment.

    How open are you to changing the layout of your data sheet 'Edit this one'
    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.

  4. #4
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Copying a Column based on List Value

    Hi Happy,

    Here's some event code for your daily planner sheet:

    Please Login or Register  to view this content.
    And Here's your book with the code and macro-enabled:


    *If you have more than 3 employees just change the red number to your number of employees!
    Attached Files Attached Files
    Last edited by xladept; 11-15-2015 at 04:32 PM.
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  5. #5
    Registered User
    Join Date
    05-16-2015
    Location
    UK
    MS-Off Ver
    2013
    Posts
    7

    Re: Copying a Column based on List Value

    Thanks for the replies everybody.

    The last solution works perfectly. I shall take your comments on board re merging cells etc.

    I do love this site!

  6. #6
    Registered User
    Join Date
    05-16-2015
    Location
    UK
    MS-Off Ver
    2013
    Posts
    7

    Re: Copying a Column based on List Value

    Thanks for the replies everybody.

    The last solution works perfectly. I shall take your comments on board re merging cells etc.

    I do love this site!

  7. #7
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Copying a Column based on List Value

    Hi Happy,

    You're welcome and thanks 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. Replies: 2
    Last Post: 04-11-2014, 12:18 PM
  2. Copying certain columns from one sheet to another based on the value on one column
    By therockerz in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-03-2014, 07:50 AM
  3. Replies: 2
    Last Post: 10-25-2013, 07:01 PM
  4. Copying data from a column based on the Date
    By Rob.Marchel in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-22-2013, 08:30 PM
  5. [SOLVED] copying specific certain column data based on cell/column value to another sheet
    By arctic7 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-09-2012, 03:38 PM
  6. [SOLVED] Copying to Multiple Sheets based on Column Value
    By LindseyF in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-17-2012, 09:42 AM
  7. copying column based on value of row 1
    By jebadiah in forum Excel General
    Replies: 5
    Last Post: 08-09-2009, 06:51 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