+ Reply to Thread
Results 1 to 9 of 9

Find value in a cell in different sheets and copy and paste other cells to another sheet

  1. #1
    Registered User
    Join Date
    07-03-2013
    Location
    france
    MS-Off Ver
    Excel 2010
    Posts
    5

    Find value in a cell in different sheets and copy and paste other cells to another sheet

    Hi,

    I'm just a beginner in Excel Macro, and I really need some help, that's about two days that I'm struggling with this problem.
    I have 3 sheets containing information, and I would like to copy some of the information they content if a condition is met to a report sheet. I have a list of contact in the 3 different sheets with different information; in one phone number, the other one the address and the last one a job. In my report sheet i would like to create a macro which when you select the first name Paul and you click on the button next to it you would have a list of the corresponding information about the different Paul which are Blond (if the result in the column Blond in the different sheet is Yes) in the different sheet. Plus I would like that in the report Sheet column Type the name of the sheet containing the information where they were taken appears.

    I don't know if it's clear enough, I join a excel file.

    Thanks a lot !
    Attached Files Attached Files
    Last edited by the-hawk; 07-03-2013 at 10:07 AM.

  2. #2
    Forum Expert Mordred's Avatar
    Join Date
    07-06-2010
    Location
    Winnipeg, Canada
    MS-Off Ver
    2007, 2010
    Posts
    2,787

    Re: Find value in a cell in different sheets and copy and paste other cells to another she

    A couple issues that I need to point out.
    1. Which sheet is the report sheet? I see Phone Number, Address, & Sheet3
    2. Where are the buttons you mention? I don't see any buttons anywhere in the workbook
    3. Where is this Paul, or blond you mention? I don't see anything like that.

    What I'm getting at is, you say:
    i would like to create a macro which when you select the first name Paul and you click on the button next to it you would have a list of the corresponding information about the different Paul which are Blond
    , you don't want to do all this, you want someone here to do all this for you, is that right?

    I don't know if you've thought of using filters or not, but they don't require code and they may be what you need. See Here for filters.
    If you're happy with someone's help, click that little star at the bottom left of their post to give them Reps.

    ---Keep on Coding in the Free World---

  3. #3
    Registered User
    Join Date
    07-03-2013
    Location
    france
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Find value in a cell in different sheets and copy and paste other cells to another she

    Hi Mordred,

    Thank you for your answer. I'm really sorry I didn't put the good file, I send the right one this time. What I did so far is in Module 2, but I don't understand why the copied cells are going to the same place (in my report) as they are in the other sheet.

    As you can see in my Module, I just copy the first two cell of the different Sheets, because I didn't find a way to copy cells which are not adjacents which other but paste it in other sheet in adjacent cells.

    About the filters I've looked it but I would like to have something automaticall and I didn't understand how to integrate it in a VBA code

    I thank you again if you may have some tips to help me.

    Address.xlsm

  4. #4
    Forum Expert Mordred's Avatar
    Join Date
    07-06-2010
    Location
    Winnipeg, Canada
    MS-Off Ver
    2007, 2010
    Posts
    2,787

    Re: Find value in a cell in different sheets and copy and paste other cells to another she

    Hi the-hawk,

    One more thing I'll need from you. I need you to set up exactly how the report sheet should look after the "Find all people named" is clicked and then re-upload that version of the workbook. Once you do that, this should be a relatively easy fix.

  5. #5
    Registered User
    Join Date
    07-03-2013
    Location
    france
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Find value in a cell in different sheets and copy and paste other cells to another she

    Hi Mordred,

    I don't know if I understood correctly but all the cells from the Report Table should look like the row 4 in the new file I uploaded. I'm asking myself how to keep that formating because when you click on the "delete all" button everything is erased (which is good) including formating ( I have to find a way to fix that).

    Thanks again

    Address.xlsm

  6. #6
    Forum Expert Mordred's Avatar
    Join Date
    07-06-2010
    Location
    Winnipeg, Canada
    MS-Off Ver
    2007, 2010
    Posts
    2,787

    Re: Find value in a cell in different sheets and copy and paste other cells to another she

    That's good the-hawk but I need to know which fields are coming from which sheet. For instance, Sheet Job has a Ref Number that is different from Address and Address Ref Number is different from Phone Number. What I was hoping for in your last upload was which data was going into the Report sheet.

    As for the format of the Report sheet, we'll be able to handle that after.

  7. #7
    Registered User
    Join Date
    07-03-2013
    Location
    france
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Find value in a cell in different sheets and copy and paste other cells to another she

    I've precised it in the row 4 in sheet report. For the Ref Number It's ok I want all of them in the same column. Is it what you were looking for ?
    Address.xlsm

  8. #8
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Find value in a cell in different sheets and copy and paste other cells to another she

    How about:
    Please Login or Register  to view this content.

  9. #9
    Registered User
    Join Date
    07-03-2013
    Location
    france
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Find value in a cell in different sheets and copy and paste other cells to another she

    Hi yudlugar,

    Thanks a lot, it works perfectly, really nice code !

+ 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