+ Reply to Thread
Results 1 to 9 of 9

Search Column A and copy to another Column

  1. #1
    Forum Contributor
    Join Date
    06-15-2013
    Location
    United States
    MS-Off Ver
    Excel 2016
    Posts
    213

    Search Column A and copy to another Column

    Hi, I'm trying to come up with a macro that will search Column A for specific fields. If the field equals the word Red then it will copy the cells from that column to column D. It will then place it in Column F starting at cell 20. It will then go back to Column A and check the next row. If it equals Blue it will then copy the first four cells in that row and then paste them in Column K cell 20. If the cell equals Red it will then go back to Column F and go to the next available cell in column F after row 20. The total options I would need would be Red, Blue, Yellow and its the words not the colors that I'm looking for. Any help is greatly appreciated.

  2. #2
    Forum Contributor
    Join Date
    07-16-2012
    Location
    Ontario Canada
    MS-Off Ver
    Excel 2010
    Posts
    124

    Re: Search Column A and copy to another Column

    Try this.


    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    06-15-2013
    Location
    United States
    MS-Off Ver
    Excel 2016
    Posts
    213

    Re: Search Column A and copy to another Column

    It works, the only thing i need help figuring out is I'm trying to get it to start pasting on row 20 in all the columns and if it comes across another record that corresponds to that color it will find the next empty row in the column its suppose to go in. Right now it sort of does that except it starts the pasting in row 2. Thanks again for your help.

  4. #4
    Forum Contributor
    Join Date
    06-15-2013
    Location
    United States
    MS-Off Ver
    Excel 2016
    Posts
    213

    Re: Search Column A and copy to another Column

    Also there will be a fourth option I will have to add which is if the cell is blank if its blank it will copy those rows into Column O. So I will need to put the limit on how many rows it checks at 5000.

  5. #5
    Forum Contributor
    Join Date
    07-16-2012
    Location
    Ontario Canada
    MS-Off Ver
    Excel 2010
    Posts
    124

    Re: Search Column A and copy to another Column

    You can make the minimum row 20 but putting a check in.
    And as you can see by the case statements, you can add more options

    Please Login or Register  to view this content.

  6. #6
    Forum Contributor
    Join Date
    06-15-2013
    Location
    United States
    MS-Off Ver
    Excel 2016
    Posts
    213

    Re: Search Column A and copy to another Column

    Works Perfect. The only thing i wonder is how do i stop it from searching Column A once it reaches 5000 rows?

  7. #7
    Forum Contributor
    Join Date
    07-16-2012
    Location
    Ontario Canada
    MS-Off Ver
    Excel 2010
    Posts
    124

    Re: Search Column A and copy to another Column

    Kind of like how you limit nbot.
    Also, This is my fault, but you should define all your variables.

    Please Login or Register  to view this content.

  8. #8
    Forum Contributor
    Join Date
    06-15-2013
    Location
    United States
    MS-Off Ver
    Excel 2016
    Posts
    213

    Re: Search Column A and copy to another Column

    Thank You!

  9. #9
    Forum Contributor
    Join Date
    07-16-2012
    Location
    Ontario Canada
    MS-Off Ver
    Excel 2010
    Posts
    124

    Re: Search Column A and copy to another Column

    No problem.
    Glad it worked for you.

+ 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. Search for a word in the column and copy it to another column on the same sheet
    By Infernon in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-07-2013, 02:19 PM
  2. Replies: 8
    Last Post: 06-04-2013, 04:36 AM
  3. [SOLVED] When a search term appears in column I, copy the value from column H to a new cell.
    By ShallowJamm in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 10-28-2012, 06:36 PM
  4. Search for Value in Closed Workbook and copy Column to Active Sheet Column BE
    By Winon in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 12-19-2011, 12:57 PM
  5. Search for column heading and copy column onto another sheet
    By chrismann85 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-28-2008, 05:53 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