+ Reply to Thread
Results 1 to 6 of 6

Macro to extract data into different sheet

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    01-05-2011
    Location
    India
    MS-Off Ver
    Excel 2013
    Posts
    243

    Macro to extract data into different sheet

    Hi,

    Is it possible to extract data into different sheet based on the below criterias.

    1) To extract all the vendor number in Column G equalling 200000 and 200001 into different sheet.
    2) For the rest, extract only 25% in random of the total rows per every USER in column B. (For Example. User Chittoju, Swathi total rows are 39 and data extract for 25% will be 10 rows in random must be copy/paste to different sheet.

    I am adding the file for you reference.

    Please help!

    Regards,
    Vijay

  2. #2
    Forum Contributor
    Join Date
    05-08-2013
    Location
    California
    MS-Off Ver
    Excel 2013
    Posts
    102

    Re: Macro to extract data into different sheet

    I hope this helps. The macro, BreakOutVendors, assumes that the raw data is always in the "For Testing" tab. All the other tabs get generated each time you run the BreakOutVendors macro.

    Version03_Deletion.xlsm

    Going on vacation!
    ________________________
    [1] If this reply was helpful, click the star to the left.
    [2] If this reply answered your question, mark this thread as [SOLVED].
    Last edited by Dimitrov; 10-12-2013 at 03:08 AM.

  3. #3
    Forum Contributor
    Join Date
    01-05-2011
    Location
    India
    MS-Off Ver
    Excel 2013
    Posts
    243

    Re: Macro to extract data into different sheet

    Thank you. It is possible to have all the data extracted in one sheet (tab) (i.e 200000 & 200001 and all users data).
    Also, sometime the 25 % count can arrives at 9.5 (e.g. 38*25/100). In that case is possible to extract the count rounding it to 10 instead of 9.

    How is the random selection happens when the macro is executed, it helps to know how the random selection is performed every time..

    Regards,
    Vijay

  4. #4
    Forum Contributor
    Join Date
    05-08-2013
    Location
    California
    MS-Off Ver
    Excel 2013
    Posts
    102

    Re: Macro to extract data into different sheet

    [1] Note the following sheets:

    200000: This sheet holds all users with Vendor Number 200000
    200001: This sheet holds all users with Vendor Number 200001
    X20 and X21: This sheet holds all users whose Vendor Numbers do NOT equal 20000 and 200001.

    [2] In terms of the rounding, I have adjusted the code to round up.

    [3] To understand how the rounding selection happens, please refer to and read the procedure in the code called RandomDeletion.

    Version05_Deletion.xlsm
    ___________________________
    [A] If this reply was helpful, click the star to the left.
    [B] If this reply answered your question, mark this thread as [SOLVED].
    Last edited by Dimitrov; 10-14-2013 at 04:45 AM.

  5. #5
    Forum Contributor
    Join Date
    01-05-2011
    Location
    India
    MS-Off Ver
    Excel 2013
    Posts
    243

    Re: Macro to extract data into different sheet

    So I should run the breakvendors first and the randomdeletion module second ?
    I think the "Breakvendors" module works fine. Only thing is after the macro is executed it all the sheets are brought together will be fine. And if the rounding is done will be helpful.

    I am not able to understand how or when do I run "Randomdeletion" module as per above suggestion.

  6. #6
    Forum Contributor
    Join Date
    05-08-2013
    Location
    California
    MS-Off Ver
    Excel 2013
    Posts
    102

    Re: Macro to extract data into different sheet

    [1] Run ONLY the BreakOutVendors. Do NOT run the RandomDeletion by itself. Do NOT run the RandomDeletion separately either. I repeat: Run ONLY the BreakOutVendors. That is all you need to do. That should give you the output that you need. The reason is that when you run the BreakOutVendors macro, it automatically will run the RandomDeletion macro for you.

    [2] Yes, as I wrote in my message above, I have changed the code so that the code will round the way you wanted. For example, 9.5 gets rounded to 10.
    ___________________________
    [A] If this reply was helpful, click the star to the left.
    [B] If this reply answered your question, mark this thread as [SOLVED].
    Last edited by Dimitrov; 10-16-2013 at 03:40 AM.

+ 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 and list data on a new sheet
    By SilverFox in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-17-2012, 10:53 AM
  2. Macro Needed to extract data from one sheet to another
    By JimmiOO in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-24-2012, 09:48 AM
  3. Macro to Extract data to another sheet
    By vijanand1279 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-02-2011, 04:48 AM
  4. [SOLVED] macro to extract data of a selected sheet
    By TUNGANA KURMA RAJU in forum Excel General
    Replies: 1
    Last Post: 02-27-2006, 02:55 AM
  5. Open Sheet, Run Macro, Extract data
    By CLR in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 11-13-2005, 08:55 PM

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