+ Reply to Thread
Results 1 to 5 of 5

Find random variable from sheet1, in sheet2, and copy entire row to sheet3

  1. #1
    Registered User
    Join Date
    08-12-2010
    Location
    Copenhagen
    MS-Off Ver
    Excel 2007
    Posts
    2

    Find random variable from sheet1, in sheet2, and copy entire row to sheet3

    Hi everyone. This is my first post. Im relatively new to VBA, and i have a problem i need solved for the place i work.

    The problem:

    I have a workbook, with two sheets.

    In Sheet1, theres alot of random client codes in colum A (approx. 50000). They look like this: 2002619458

    In Sheet 2, coloum A, theres alot of clientnumbers too. From coloum B to AW, is alot of random information.

    Now, i would like my VBA code to start in sheet one, top of coloum A, take that clientnumber, search for it in Sheet2 coloum A, and IF it finds it, copy that entire row to sheet3.

    I've really googled this, and looked at other forums. I've found some code that might be helpful, but i simply can't see how to get it to work for me. I think the code below, is what comes the closest:

    Please Login or Register  to view this content.
    Hope you can help.

    - Tobias
    Last edited by TMorville; 08-12-2010 at 05:52 AM.

  2. #2
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Find random variable in FROM sheet1, in sheet2, and copy entire row to sheet3

    Your first problem is that you need to add code tags as per the forum rules. Then somebody can help you.

  3. #3
    Registered User
    Join Date
    08-12-2010
    Location
    Copenhagen
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Find random variable in FROM sheet1, in sheet2, and copy entire row to sheet3

    Thanks for pointing it out for me. Its done. I think?

  4. #4
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Find random variable from sheet1, in sheet2, and copy entire row to sheet3

    Nearly. They are quote tags. Use # for code tags.

  5. #5
    Forum Expert
    Join Date
    07-16-2010
    Location
    Northumberland, UK
    MS-Off Ver
    Excel 2007 (home), Excel 2010 (work)
    Posts
    3,054

    Re: Find random variable from sheet1, in sheet2, and copy entire row to sheet3

    Your code is running in just about the slowest way possible, but you won't have noticed because it's only running on a very small range of cells.

    Try this instead:

    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)

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