+ Reply to Thread
Results 1 to 11 of 11

IF with PIVOT (I want to copy some of the table to the other sheet in excel)

  1. #1
    Registered User
    Join Date
    03-19-2017
    Location
    Turkey
    MS-Off Ver
    2010
    Posts
    12

    Question IF with PIVOT (I want to copy some of the table to the other sheet in excel)

    Hi there,

    I am new in here so I am sorry for any mistake.

    I have table in an excel spreadsheet that I would like to take some informations to the other sheet.

    I am not sure if I could upload the sample file ,so I did summarize my excel table above. IF I could manage the upload , please take a look at it

    In the table;
    Bcoloumn is "Country" H "products interested"
    C is "adress" I "notes"
    D is "firm" J "action"
    E is "telephone number"
    F is "e-mail"
    G "scope of activity" ,


    SO here the question.. I would like to take "country" "firm" "e-mail" sections to the other sheet IF ACTION PART IS "MAIL SENT" !!

    And I am assuming that I could solve this with Pivot table so thats why the title is Pivot .

    Many thanks!!
    Attached Files Attached Files
    Last edited by Melikec; 03-21-2017 at 03:05 AM.

  2. #2
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: IF with PIVOT (I want to copy some of the table to the other sheet in excel)

    There are a few ways to achieve the table you want
    Here is a solution that uses Advanced Filter
    Note that I inserted 1 row in the source sheet to create a gap between the table and the "Criteria Range"

    1.Create the "Criteria Range" in the source sheet - note the heading must be IDENTICAL to main table

    AdvFilterSource.jpg

    2. Go to Destination sheet and create the headings you want - note the headings must be EXACTLY the same as in main table - so perhaps use a formula to put the values there
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    AdvFilterDestination.jpg

    3. Move cursor away from headings to cell D8 perhaps

    4. Click on Data tab and Advanced Filter
    (CURSOR MUST BE IN THE DESTINATION SHEET WHEN YOU CLICK ON ADVANCED FILTER)
    - select "Copy to another location"
    - set up the ranges as per image
    - note that the "List Range" is the whole table including headings

    AdvFilterRanges.jpg

    5. Click "OK"

    AdvFilterResult.jpg
    Last edited by kev_; 03-21-2017 at 05:06 AM.
    Click *Add Reputation to thank those who helped you. Ask if anything is not clear

  3. #3
    Valued Forum Contributor
    Join Date
    05-11-2013
    Location
    Wales
    MS-Off Ver
    Excel 2010
    Posts
    586

    Re: IF with PIVOT (I want to copy some of the table to the other sheet in excel)

    Hi,

    Here's another way of doing it with a Pivot Table using the Action as a filter - please see attached.

    Is this what you are after?

    Regards

    peterrc
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    03-19-2017
    Location
    Turkey
    MS-Off Ver
    2010
    Posts
    12

    Re: IF with PIVOT (I want to copy some of the table to the other sheet in excel)

    Hey there,
    thank you for your answer. But I have a question with apologies.
    I did write "action" and "mail sent" to the page 1. and then go to the destination sheet and click advanced filter as you did. But the advance filter didnt work and it gave me some errors one of them is "select a cell range contains at least two data rows" , I didnt get it.
    Could you kindly explain it?

  5. #5
    Registered User
    Join Date
    03-19-2017
    Location
    Turkey
    MS-Off Ver
    2010
    Posts
    12

    Re: IF with PIVOT (I want to copy some of the table to the other sheet in excel)

    Quote Originally Posted by peterrc View Post
    Hi,

    Here's another way of doing it with a Pivot Table using the Action as a filter - please see attached.

    Is this what you are after?

    Regards

    peterrc
    Hello ,
    Thank you for your answer and yes.. That is what I am looking for. but when I did the pivot like this I have a different result. And here is what I am talking about:
    Help Forum.xlsx

    "Sayfa 4" is my first move, and when I add "firm" to the pivot "sayfa5" occurs . So where do you think I make a mistake?

  6. #6
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: IF with PIVOT (I want to copy some of the table to the other sheet in excel)

    Perhaps you did not select the List Range correctly

    AdvFilt01.jpg


    AdvFilt02.jpg

  7. #7
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: IF with PIVOT (I want to copy some of the table to the other sheet in excel)

    Attached is file containing a macro to create it automatically
    Open the file, enable macros and run the macro with {CTRL} t

    Please Login or Register  to view this content.
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    03-19-2017
    Location
    Turkey
    MS-Off Ver
    2010
    Posts
    12

    Re: IF with PIVOT (I want to copy some of the table to the other sheet in excel)

    Quote Originally Posted by kev_ View Post
    Perhaps you did not select the List Range correctly

    Attachment 508550


    Attachment 508552
    Thank you for your support very much! I understand it now. It helped a lot and I learn new things thanks to your explanations.

    Do you think there is a way if I change one action from f.e "replied" to "mail sent" the sheet in 2nd page automatically changes? or is it a whole different topic that I shouldn't write here.

    And if I change criteria range from "mail sent" to another criteria, does the 2nd sheet automatically change or do I need to make another advance filter from the beginning ?
    Last edited by Melikec; 03-23-2017 at 05:12 AM. Reason: asking another question

  9. #9
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: IF with PIVOT (I want to copy some of the table to the other sheet in excel)

    Have a look at the file I attached in post#7
    I put a dropdown in the J2

    Change the value and run the macro again

  10. #10
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: IF with PIVOT (I want to copy some of the table to the other sheet in excel)

    I have updated the file so that it automatically runs the macro when you change the selection in J2
    Download and Open the attached file, enable macros, and change the selected value in J2


    This was added in the sheet module
    Please Login or Register  to view this content.
    (right-click on sheet tab Sayfa1 and select "view code")
    Attached Files Attached Files

  11. #11
    Valued Forum Contributor
    Join Date
    05-11-2013
    Location
    Wales
    MS-Off Ver
    Excel 2010
    Posts
    586

    Re: IF with PIVOT (I want to copy some of the table to the other sheet in excel)

    Hi,

    In order to replicate what I have done you need to:-

    1. Change the Report Layout to Tabular Format (in Pivot Table Design)
    2. Set subtotals to "Do Not Show Subtotals" (in Pivot Table Design)
    3. Add both firm and e-mail to the Row Labels under country

    Regards

    peterrc

+ 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. [SOLVED] IF with PIVOT (I want to copy some of the table to the other sheet in excel)
    By Melikec in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-23-2017, 02:22 AM
  2. [SOLVED] Excel 2013: Copy Pivot Table Values to New Sheet and Retain Formatting
    By greatjobtoday in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 03-27-2015, 08:07 AM
  3. Copy pivot table to another sheet
    By Smudge.Smith in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-31-2014, 09:27 AM
  4. Copy pivot table to another sheet
    By Smudge.Smith in forum Excel General
    Replies: 0
    Last Post: 10-31-2014, 09:27 AM
  5. Identify table, Get Pivot, Copy the pivot table to new consolidated Sheet
    By akhileshgs in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-27-2013, 04:09 AM
  6. Need to Copy the Pivot table Data in the same/different Sheet using VBA
    By e4excel in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-05-2013, 03:33 AM
  7. copy pivot table data to next available sheet in a certain workbook
    By bsigmon1103 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-19-2012, 12:45 PM

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