+ Reply to Thread
Results 1 to 16 of 16

Write a code that looks for "True" in a certain column and copy paste to a new sheet

  1. #1
    Registered User
    Join Date
    09-16-2014
    Location
    upstate, ny
    MS-Off Ver
    2013
    Posts
    8

    Write a code that looks for "True" in a certain column and copy paste to a new sheet

    I'm new to vba and having no luck writing a code to do what I want. I want to copy a whole row to a new sheet if the value in column L is "True".


    this is what I have done
    Please Login or Register  to view this content.
    Book1.xlsm

    if I delete all the data from sheet3 and run the macro I get the seven rows that contain true in column L

    I believe there is a way to write an "if then" statement to search the whole sheet of 40000 numbers.

    I have searched the forums and tried to insert and bend the codes I found here to make this work and I'm honestly lost.
    Any help is greatly appreciated.
    Last edited by rangerman50ho; 09-18-2014 at 09:57 AM. Reason: corrections to post

  2. #2
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,661

    Re: Write a code that looks for "True" in a certain column and copy paste to a new sheet

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    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



    (This thread should receive no further responses until this moderation request is fulfilled, as per Forum Rule 7)
    Ben Van Johnson

  3. #3
    Registered User
    Join Date
    09-16-2014
    Location
    upstate, ny
    MS-Off Ver
    2013
    Posts
    8

    Re: Write a code that looks for "True" in a certain column and copy paste to a new sheet

    My apologies, hopefully these corrections will help everyone, again thank you for your time

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

    Re: Write a code that looks for "True" in a certain column and copy paste to a new sheet

    Maybe:

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    09-16-2014
    Location
    upstate, ny
    MS-Off Ver
    2013
    Posts
    8

    Re: Write a code that looks for "True" in a certain column and copy paste to a new sheet

    Thank you, That works on my sample but not on my actual. Any thoughts?
    I'm going to try to start a new workbook with the info in it and see what that does.

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

    Re: Write a code that looks for "True" in a certain column and copy paste to a new sheet

    Do you receive and Error? Can't tell why it wouldn't work unless I could see it. I'll wait and see what happens in the new workbook.

  7. #7
    Registered User
    Join Date
    09-16-2014
    Location
    upstate, ny
    MS-Off Ver
    2013
    Posts
    8

    Re: Write a code that looks for "True" in a certain column and copy paste to a new sheet

    okay, the new sheet it creates is blank, and the on the second tab it hides the rest of the information.

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

    Re: Write a code that looks for "True" in a certain column and copy paste to a new sheet

    Can you post the code you are using?

  9. #9
    Registered User
    Join Date
    09-16-2014
    Location
    upstate, ny
    MS-Off Ver
    2013
    Posts
    8

    Re: Write a code that looks for "True" in a certain column and copy paste to a new sheet

    Please Login or Register  to view this content.

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

    Re: Write a code that looks for "True" in a certain column and copy paste to a new sheet

    Quote Originally Posted by rangerman50ho View Post
    okay, the new sheet it creates is blank, and the on the second tab it hides the rest of the information.
    Do you have Header rows? If so what are they.

  11. #11
    Registered User
    Join Date
    09-16-2014
    Location
    upstate, ny
    MS-Off Ver
    2013
    Posts
    8

    Re: Write a code that looks for "True" in a certain column and copy paste to a new sheet

    yes, the headers are

    LINE PART 2014 SALES 2013 SALES PRICE1 PRICE3 PRICE5 PRICE10 CORE DESCRIPTION UPC 1 H>F 1.25 H*M N-F N>F O>10

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

    Re: Write a code that looks for "True" in a certain column and copy paste to a new sheet

    What row are they on?

  13. #13
    Registered User
    Join Date
    09-16-2014
    Location
    upstate, ny
    MS-Off Ver
    2013
    Posts
    8

    Re: Write a code that looks for "True" in a certain column and copy paste to a new sheet

    They begin on row one.

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

    Re: Write a code that looks for "True" in a certain column and copy paste to a new sheet

    It should work. Try this instead.

    Please Login or Register  to view this content.

  15. #15
    Registered User
    Join Date
    09-16-2014
    Location
    upstate, ny
    MS-Off Ver
    2013
    Posts
    8

    Re: Write a code that looks for "True" in a certain column and copy paste to a new sheet

    That one makes even my sample "new sheet" blank

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

    Re: Write a code that looks for "True" in a certain column and copy paste to a new sheet

    Works for me.

+ 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: 7
    Last Post: 03-17-2014, 01:51 PM
  2. [SOLVED] Copy multiple rows that contain a certain "name" in column "A" then paste it into new work
    By rschlot2 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-18-2013, 02:25 PM
  3. Copy/Paste columns into new sheet when column header = "XXX"
    By gandha in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-23-2012, 09:31 PM
  4. Replies: 3
    Last Post: 08-15-2012, 04:00 AM
  5. 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

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