+ Reply to Thread
Results 1 to 11 of 11

Macro to extract items on seprate sheet pertaining to N/A

  1. #1
    Forum Contributor
    Join Date
    07-12-2018
    Location
    South Africa
    MS-Off Ver
    Office 2021
    Posts
    2,776

    Macro to extract items on seprate sheet pertaining to N/A

    I have account numbers in Col F on sheet


    Where #N/A appears in Col F on "Import Data", I want all the data on sheet "GL Numbers" to be copied to sheet "extract items NA" based on the following criteria


    Where reference numbers in Col A on sheet "GL Numbers" is the same as the ref numbers on sheet "Import Data" , and the sum of the values in Col G on Sheet "GL Numbers" agrees to the value in Col D , then extract the data on sheet "GL Numbers" to sheet "extract items NA"


    I have attached sample data and manually extracted the data to sheet "extract items NA"


    Your assistance regarding the above is most appreciated
    Attached Files Attached Files

  2. #2
    Banned User!
    Join Date
    02-06-2020
    Location
    Iowa City, IA, USA
    MS-Off Ver
    2016 - 365 / 2007
    Posts
    2,014

    Re: Macro to extract items on seprate sheet pertaining to N/A

    Howard,

    I'm pretty sure you can do this through the interface. for the refs matching on the ''GL'' sheet to the ''IMmport Data'' sheet, I'm sure you can use VLOOKUP(). You might also be able to use what many pros do. The combination of INDEX() and MATCH(). You may have to write some code as well to get the last part of your request done. At least that's how I would do it. But I'm also pretty sure you can do everything you need with the built-in resources of Excel with no code.

  3. #3
    Forum Contributor
    Join Date
    07-12-2018
    Location
    South Africa
    MS-Off Ver
    Office 2021
    Posts
    2,776

    Re: Macro to extract items on seprate sheet pertaining to N/A

    Hi Adam

    Thanks for the reply. As sheet2 has the same reference appearing several times and the value makes up one reference on sheet1, I am bot sure that one can use either Vlookup and Index/Match to extract the info

  4. #4
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,517

    Re: Macro to extract items on seprate sheet pertaining to N/A

    I assume only positive figures are important...
    Please Login or Register  to view this content.
    Good Luck...
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the [★ Add Reputation] to left of post window...
    Also....Add a comment if you like!!!!
    And remember...Mark Thread as Solved...
    Excel Forum Rocks!!!

  5. #5
    Banned User!
    Join Date
    02-06-2020
    Location
    Iowa City, IA, USA
    MS-Off Ver
    2016 - 365 / 2007
    Posts
    2,014

    Re: Macro to extract items on seprate sheet pertaining to N/A

    looks like you got a solution Howard. please post back if it solved this for you. I think people here appreciate that.

  6. #6
    Forum Contributor
    Join Date
    07-12-2018
    Location
    South Africa
    MS-Off Ver
    Office 2021
    Posts
    2,776

    Re: Macro to extract items on seprate sheet pertaining to N/A

    Hi Sintek

    Only the positive figures are of importance

    Thanks for the help, code works perfectly

  7. #7
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,517

    Re: Macro to extract items on seprate sheet pertaining to N/A

    Glad I could assist...
    Last edited by Sintek; 08-14-2020 at 01:45 PM.

  8. #8
    Forum Contributor
    Join Date
    07-12-2018
    Location
    South Africa
    MS-Off Ver
    Office 2021
    Posts
    2,776

    Re: Macro to extract items on seprate sheet pertaining to N/A

    hi Sintek


    I tried to apply you code to another workbook buy amending the code to suit the particular needs , and the layout of the heading and number of columns differs on sheet1 from the example you kindly helped me with but the criteria is exactly the same

    when running the code, I get type mismatch and the ode below is highlighted


    I have attached the sample data as well as what the extracted data should look like but doing this manually

    Kindly amend the code


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

  9. #9
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,517

    Re: Macro to extract items on seprate sheet pertaining to N/A

    File is corrupt...

  10. #10
    Forum Contributor
    Join Date
    07-12-2018
    Location
    South Africa
    MS-Off Ver
    Office 2021
    Posts
    2,776

    Re: Macro to extract items on seprate sheet pertaining to N/A

    Thanks for letting me know. I went through your original code and amended it so that it conformed to the changes. It now makes sense why it never worked


    Will set up a new workbook

  11. #11
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,565

    Re: Macro to extract items on seprate sheet pertaining to N/A

    Not relevant.
    Last edited by jolivanes; 08-28-2020 at 01:14 PM. Reason: Wrong assumption

+ 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] Macro to extract items not used
    By Howardc1001 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-04-2019, 11:37 AM
  2. [SOLVED] Was wondering if this Macro could be adopted to work accrossed 3 column on 3 seprate sheet
    By meabrams in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-25-2015, 04:38 PM
  3. Extract of line items or entries having unique *6 digit ref* - using Macro VBA
    By Ram_G in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-08-2015, 12:23 AM
  4. [SOLVED] how to seprate data from master sheet to process
    By Santhosh AMASL in forum Excel General
    Replies: 0
    Last Post: 01-28-2015, 09:00 AM
  5. Macro help pertaining to compare
    By lorenzoscott78 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-03-2013, 06:33 PM
  6. Replies: 1
    Last Post: 06-16-2010, 07:47 AM
  7. Emailing Page-breaks as seprate sheet
    By Murtaza in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-04-2005, 10:06 AM

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