+ Reply to Thread
Results 1 to 10 of 10

If cell X's content in Sheet A equals to cell Y's content in Sheet B, Then copy some data.

  1. #1
    Registered User
    Join Date
    08-06-2012
    Location
    IN, US
    MS-Off Ver
    Excel 2007
    Posts
    11

    If cell X's content in Sheet A equals to cell Y's content in Sheet B, Then copy some data.

    I know it will be a really tough one. If I can get some help, that will be awesome! Thanks first!

    If cell X's content in Sheet A (i.e. B1 -> B10) equals to cell Y's content in Sheet B (i.e. B1 -> B100),

    Then copy cell Y + 2 content in Sheet B (Find B7 in Sheet B matches B1 in Sheet A, so read D7) to cell X +2 in Sheet A (write the value to D1 in Sheet A).

    Last edited by sunheroj; 08-06-2012 at 06:15 PM.

  2. #2
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: If cell X's content in Sheet A equals to cell Y's content in Sheet B, Then copy some d

    Hi

    The way I read this, VLOOKUP should be a viable option.

    rylo

  3. #3
    Registered User
    Join Date
    08-06-2012
    Location
    IN, US
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: If cell X's content in Sheet A equals to cell Y's content in Sheet B, Then copy some d

    It's like look up the description of this data from the database. Sheet A is random few data, and Sheet B is the database which contains all the info.

  4. #4
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: If cell X's content in Sheet A equals to cell Y's content in Sheet B, Then copy some d

    so have you tried the VLOOKUP function? If so, does it work? If not, then can you attach an example file for review.

    rylo

  5. #5
    Registered User
    Join Date
    08-06-2012
    Location
    IN, US
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: If cell X's content in Sheet A equals to cell Y's content in Sheet B, Then copy some d

    Let me try it. Thanks a lot!

  6. #6
    Registered User
    Join Date
    08-06-2012
    Location
    IN, US
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: If cell X's content in Sheet A equals to cell Y's content in Sheet B, Then copy some d

    I tried to use a stupid method to approch but I got error...



    Please Login or Register  to view this content.

    And the error is Run-time error '438':
    Object doesn't support this property or method.
    in line " Sheets("datainbuild").Cell(p, 2).Copy"

    If anyone could give me some suggestions or hints, that's will be great! Thanks for help!
    Last edited by Cutter; 08-08-2012 at 04:43 PM. Reason: Added code tags

  7. #7
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: If cell X's content in Sheet A equals to cell Y's content in Sheet B, Then copy some d

    @ sunheroj

    Welcome to the forum.

    Please notice that code tags have been added to your post(s). The forum rules require them so please keep that in mind and add them yourself whenever showing code in any of your future posts. To see instructions for applying them, click on the Forum Rules button at top of the page and read Rule #3.
    Thanks.

  8. #8
    Registered User
    Join Date
    08-06-2012
    Location
    IN, US
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: If cell X's content in Sheet A equals to cell Y's content in Sheet B, Then copy some d

    Thanks! Cutter, I will do that! I just figured out the problem by myself.
    BTW, I have a link where have a free online book about Macros:

    http://www.doc88.com/p-20924486358.html

    But I'm not sure if it is good or not.

    And I have one more problem which is.... Is there a way we can copy whole content of Sheet A in an already opened .csv (which contains sheetA) to an empty Sheet B in another already opened .csv (which contains sheetB) by macro?

    Thanks a lot!

  9. #9
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: If cell X's content in Sheet A equals to cell Y's content in Sheet B, Then copy some d

    @ sunheroj

    It sounds like the issue you started this thread for has been solved. You should show what the final solution is so that others coming across this thread can benefit from it. After that, please remember to mark your thread as Solved.

    New quick method:
    Select Thread Tools (above first post on page) -> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

    Or you can use this way:
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word "Title" you will see a dropdown with the words "No prefix".
    Change to "Solved"
    Click Save

    Also, as a new member of the forum, you may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of those who helped.

    As for your new question please start a new thread. Thanks

  10. #10
    Registered User
    Join Date
    08-06-2012
    Location
    IN, US
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: If cell X's content in Sheet A equals to cell Y's content in Sheet B, Then copy some d

    Sorry for the late reply. These are my correct macro. I forgot "s" after cell that made the error.

    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