+ Reply to Thread
Results 1 to 5 of 5

In a table, Need to copy cells in column A only if a cell in C-F contain a "1".

  1. #1
    Registered User
    Join Date
    07-02-2020
    Location
    California, USA
    MS-Off Ver
    10
    Posts
    2

    In a table, Need to copy cells in column A only if a cell in C-F contain a "1".

    Please see attached Excel for example. I am trying to set up a program that if I have an input will select the correct results from the Data. In this case, If I use the input "1", I need a program that will go to the 1 column and copy over only the Values in Colume A that are True (T). The only way I know how to do it is a rather long way.

    Please Login or Register  to view this content.
    However in my real life case I have maybe 50 columns? Is there a more general way to write this program? Meaning I would need to do this for all 50 cases.

    Thank you for any help!
    Attached Files Attached Files

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,621

    Re: In a table, Need to copy cells in column A only if a cell in C-F contain a "1".

    Administrative Note:

    Welcome to the forum.

    We would very much like to help you with your query, however you need to include code tags around your code.

    Please take a moment to add the tags. Posting code between tags makes your code much easier to read and copy for testing, and it also maintains VBA formatting.

    Please see Forum Rule #2 about code tags and adjust accordingly. Click on Edit to open your post, then highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here

    (Note: this change is not optional. As you are new, I shall do it for you today.)
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    07-02-2020
    Location
    California, USA
    MS-Off Ver
    10
    Posts
    2

    Re: In a table, Need to copy cells in column A only if a cell in C-F contain a "1".

    Oh I'm very sorry! Thank you for the correction!

  4. #4
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,540

    Re: In a table, Need to copy cells in column A only if a cell in C-F contain a "1".

    As it has been over 24 hours since post #3 and there has not been a response I thought that I would offer a formula based proposal.
    Paste the following into cell B2 on the Main sheet:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    After activating the formula by pressing enter, drag the fill handle down to cell B6 and then, while B2:B6 are still selected, drag the fill handle over to cell F6.
    Let us know if you have any questions.
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  5. #5
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,518

    Re: In a table, Need to copy cells in column A only if a cell in C-F contain a "1".

    VBA
    Please Login or Register  to view this content.

+ 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] Column X-Ref list - Sheet1 Col A "pages", Col B:FL "Req" to Sheet2 ColA "req", ColB "page"
    By excel-card-pulled in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 04-07-2017, 09:30 AM
  2. Macro to copy cells from workbook,where column C is = "num1" AND Column D ="num2"
    By jarious87 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-10-2013, 03:30 PM
  3. [SOLVED] macro to search for "NO" in a cell and copy all but "NO" to a different column! plz help
    By fredderf81 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-26-2013, 03:19 PM
  4. [SOLVED] If there is any text in column "A$" on "sheet1" then move cell to column "A$" on "sheet2"
    By ckgeary in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 06-27-2013, 08:28 PM
  5. Replies: 2
    Last Post: 06-06-2013, 12:45 PM
  6. Replies: 9
    Last Post: 11-06-2012, 08:59 AM
  7. Copy value from column "X" paste into Column "Y" - visible cells
    By kaseyleigh in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-22-2012, 05:46 AM

Tags for this Thread

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