+ Reply to Thread
Results 1 to 10 of 10

Using find and copy, but only want it to search in 1st column

  1. #1
    Registered User
    Join Date
    04-22-2013
    Location
    In the lab...
    MS-Off Ver
    Excel 2010
    Posts
    12

    Using find and copy, but only want it to search in 1st column

    Hello all,

    I'm using the macro below to search for a user-defined number in column A, and copy/paste only the rows that begin with that value into another sheet. The only problem is that it currently is looking in all of the columns for the user-defined number and copy/pasting the rows containing it, no matter which column the number appears in. How do I tell it to only grab the rows that have the user-defined number in column A?

    Please Login or Register  to view this content.
    Thanks so much,

    Nikolette

  2. #2
    Forum Contributor
    Join Date
    01-02-2007
    Location
    Australia NSW
    MS-Off Ver
    2013
    Posts
    494

    Re: Using find and copy, but only want it to search in 1st column

    Works for me as is.
    Last edited by coreytroy; 06-17-2013 at 06:59 PM.

  3. #3
    Registered User
    Join Date
    04-22-2013
    Location
    In the lab...
    MS-Off Ver
    Excel 2010
    Posts
    12

    Re: Using find and copy, but only want it to search in 1st column

    A message box pops up and you put the number you want to look for...

  4. #4
    Forum Contributor
    Join Date
    01-02-2007
    Location
    Australia NSW
    MS-Off Ver
    2013
    Posts
    494

    Re: Using find and copy, but only want it to search in 1st column

    Sorry just tested. Works OK for me as it is.

  5. #5
    Registered User
    Join Date
    04-22-2013
    Location
    In the lab...
    MS-Off Ver
    Excel 2010
    Posts
    12

    Re: Using find and copy, but only want it to search in 1st column

    It works beautifully if column A is the only column that contains the number you're looking for...if it appears in any other column, it grabs those rows as well. I need it to only grab the rows that have the number at the beginning of the row, in column A...

  6. #6
    Registered User
    Join Date
    04-22-2013
    Location
    In the lab...
    MS-Off Ver
    Excel 2010
    Posts
    12

    Re: Using find and copy, but only want it to search in 1st column

    Bump......

  7. #7
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Using find and copy, but only want it to search in 1st column

    Nik,
    You do not have a find/search function in your code.
    What you have is a function to find the last non empty row in your data

    Please Login or Register  to view this content.
    You can use this line to find the last row in column A
    Please Login or Register  to view this content.
    But you will still have the same issue. I suspect the issue you have is this line which copies the entire row instead of limited columns.
    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    04-22-2013
    Location
    In the lab...
    MS-Off Ver
    Excel 2010
    Posts
    12

    Re: Using find and copy, but only want it to search in 1st column

    Thank you, AB33...I do want it to copy the entire row, but only rows that have the given number in column A. I need a way to tell it not to look for the number in any column except for column A.

  9. #9
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Using find and copy, but only want it to search in 1st column

    Try this line

    Please Login or Register  to view this content.
    Last edited by AB33; 06-20-2013 at 04:19 AM.

  10. #10
    Registered User
    Join Date
    04-22-2013
    Location
    In the lab...
    MS-Off Ver
    Excel 2010
    Posts
    12

    Re: Using find and copy, but only want it to search in 1st column

    That works perfectly! Thank you, AB33 :-)

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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