+ Reply to Thread
Results 1 to 9 of 9

Macro for extracting data from multiple sheets if cell has text

  1. #1
    Forum Contributor
    Join Date
    06-20-2011
    Location
    Auckland, NZ
    MS-Off Ver
    Excel 2013
    Posts
    165

    Macro for extracting data from multiple sheets if cell has text

    Hi there,

    I have a workbook with multiple sheets each containing prices (and other information) for certain items. I need to extract data from multiple sheets onto one sheet called "master". But the issue that I have is I need the data to be extracted from only the specific cells that have text in it from multiple sheets. I am attaching a workbook for your reference. In that worksheet, Price1 and Price2 are the sheets from which I need to extract the information. "master" is the sheet where I need the data to be extracted. Sample data is provided within the attached worksheet. Can I get VBA code for the requested, please?

    Thanks in advance.

    Plasma33
    Attached Files Attached Files
    Last edited by plasma33; 11-12-2016 at 09:41 PM. Reason: corrected something

  2. #2
    Forum Guru karedog's Avatar
    Join Date
    10-03-2014
    Location
    Indonesia
    MS-Off Ver
    2003
    Posts
    2,971

    Re: Macro for extracting data from multiple sheets if cell has text

    Maybe :
    Please Login or Register  to view this content.
    1. I care dog
    2. I am a loop maniac
    3. Forum rules link : Click here
    3.33. Don't forget to mark the thread as solved, this is important

  3. #3
    Forum Contributor
    Join Date
    06-20-2011
    Location
    Auckland, NZ
    MS-Off Ver
    Excel 2013
    Posts
    165

    Re: Macro for extracting data from multiple sheets if cell has text

    Hi karedog,

    Thank you for your kind comment. The code given by you is not working for me. I am getting "Run-time error '1004' Application-defined or object-defined error" error. I don't get a debug option.

    Plasma33

  4. #4
    Forum Guru karedog's Avatar
    Join Date
    10-03-2014
    Location
    Indonesia
    MS-Off Ver
    2003
    Posts
    2,971

    Re: Macro for extracting data from multiple sheets if cell has text

    Do you change your data layout ? I don't get any error :
    Attached Files Attached Files

  5. #5
    Forum Contributor
    Join Date
    06-20-2011
    Location
    Auckland, NZ
    MS-Off Ver
    Excel 2013
    Posts
    165

    Re: Macro for extracting data from multiple sheets if cell has text

    Hi karedog,

    Thank you for clarifying this for me. It's working as it should but it doesn't work when I input some new texts. The code doesn't update the new ones apart from the ones that we already have. Also, can you please automate the price category section (i.e. Field 1) too. At the moment it's static. Can you please make sure that the code works for any dynamic data and not just for the data that I provided. I have attached the excel file for your reference. Thanks heaps.

    Plasma33
    Attached Files Attached Files
    Last edited by plasma33; 11-10-2016 at 09:15 PM. Reason: missed something

  6. #6
    Forum Guru karedog's Avatar
    Join Date
    10-03-2014
    Location
    Indonesia
    MS-Off Ver
    2003
    Posts
    2,971

    Re: Macro for extracting data from multiple sheets if cell has text

    You are welcome, thanks for the rep.points.

    Please check the attached file.
    Attached Files Attached Files

  7. #7
    Forum Contributor
    Join Date
    06-20-2011
    Location
    Auckland, NZ
    MS-Off Ver
    Excel 2013
    Posts
    165

    Re: Macro for extracting data from multiple sheets if cell has text

    Thank you and you are welcome too. This works perfectly but has one small issue. It's extracting all the data as it should but it's not extracting some data i.e. row 7 onwards the data are not extracting both for "Price1" and "Price2" spreadsheets. I am attaching the excel file for your reference. You can see that the data from row 8 and row 12 from "Price1" as well as row 9 and row 12 from "Price2" spreadsheets are not extracting at all. Thanks again .

    Plasma33
    Attached Files Attached Files

  8. #8
    Forum Guru karedog's Avatar
    Join Date
    10-03-2014
    Location
    Indonesia
    MS-Off Ver
    2003
    Posts
    2,971

    Re: Macro for extracting data from multiple sheets if cell has text

    Because that is what on your manual calculation on your original file on post #1.
    In your original file, for Product Category 2 there are 2 data matched(row 8 and 12), but on your manual calculation on sheet master, you only list one, so I assume that you only want to display only the first matched item.

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

  9. #9
    Forum Contributor
    Join Date
    06-20-2011
    Location
    Auckland, NZ
    MS-Off Ver
    Excel 2013
    Posts
    165

    Re: Macro for extracting data from multiple sheets if cell has text

    Thanks, karedog. It's working perfectly and for all the other combinations too.

    Plasma33

+ 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] Extracting Data from Multiple Sheets
    By doublea17 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-06-2016, 03:18 PM
  2. [SOLVED] Extracting data from multiple columns on multiple sheets / tabs etc to a common matrix
    By MagicMan in forum Excel Programming / VBA / Macros
    Replies: 22
    Last Post: 03-26-2015, 07:38 AM
  3. Replies: 0
    Last Post: 07-29-2013, 03:00 AM
  4. Replies: 0
    Last Post: 10-10-2012, 08:56 AM
  5. RE: Extracting Data from multiple sheets/rows
    By stuckinlondon in forum Excel General
    Replies: 3
    Last Post: 09-24-2011, 10:56 AM
  6. RE: Extracting Data from multiple sheets/rows
    By stuckinlondon in forum Excel General
    Replies: 4
    Last Post: 08-19-2011, 09:09 AM
  7. Extracting Data from Multiple Sheets in to one
    By RichardWard in forum Excel General
    Replies: 3
    Last Post: 08-16-2011, 06:04 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