Results 1 to 8 of 8

Use of Loop Function for extracting data from Master sheet and creating seperate files

Threaded View

  1. #1
    Registered User
    Join Date
    09-23-2015
    Location
    India
    MS-Off Ver
    2010
    Posts
    24

    Use of Loop Function for extracting data from Master sheet and creating seperate files

    Hi Everyone,

    I am looking for help to automate a report. Let me explain what exactly I want.

    There is master sheet in which we have data in around 1.2 lakhs rows and in column A to M. In column I there are around more then 300 vendor names given and i want to extract the data vendor wise in a separate tab then save that file with same vendor name in a different folder. I have used the below coding which gives me what exactly i want but its very difficult to use this again and again for more then 300 vendors. its good only for few data but currently the data is in more then one lakh rows.

    Rows("1:1").Select
    Selection.AutoFilter
        ActiveSheet.Range("$A$1:$M$150000").AutoFilter Field:=9, Criteria1:= _
            "CS Retail Pvt. Ltd"
        Rows("2:2").Select
        Range(Selection, Selection.End(xlDown)).Select
        Selection.Copy
        Sheets("MakeFile").Select
        Range("A2").Select
        ActiveSheet.Paste
        Cells.EntireColumn.AutoFit
        Cells.EntireColumn.AutoFit
        Cells.EntireRow.AutoFit
        Cells.EntireRow.AutoFit
        Rows("2:2").Select
        Range(Selection, Selection.End(xlDown)).Select
        Selection.RowHeight = 16
        Range("A1").Select
        Sheets("MakeFile").Select
        Sheets("MakeFile").Copy
        Sheets("MakeFile").Name = "MASTER PENDENCY 2012 ONWARDS"
        Range("A1").Select
        ActiveWorkbook.SaveAs Filename:= _
            "C:\Users\ankit.jainaj\Desktop\Rohit\CS Retail Pvt. Ltd.xlsx", FileFormat _
            :=xlOpenXMLWorkbook, CreateBackup:=False
                  ActiveWindow.Close
        Rows("2:2").Select
        Range(Selection, Selection.End(xlDown)).Select
        Selection.Delete Shift:=xlUp
      
        Range("A2").Select


    Therefore, I want if some can help me for coding of loop through which i can extract the data vendor wise and create a separate files with same vendor naming convention in different folder. if this work then i will get more then 300 separate files in different folder.

    Please help me asap as its urgent.

    Let me know in case if something is not clear.

    Thanks.
    Ankit Jain
    Last edited by alansidman; 05-12-2016 at 12:19 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. loop through file creating seperate files depending on name in a column
    By papasmurfuo9 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 03-17-2015, 06:37 AM
  2. Need help extracting data from multiple files into one master
    By brstrick in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-04-2015, 02:48 AM
  3. [SOLVED] Extracting Data from a Master Sheet to Sub Sheets
    By firemanli in forum Excel General
    Replies: 8
    Last Post: 04-26-2014, 08:46 PM
  4. Extracting data from multiple .xls files in folder and creating new workbook
    By haedyr in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-01-2013, 07:28 PM
  5. Export data from master sheet to seperate worksheets dependent on 1-2 conditions
    By Cupomaxwell in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-10-2013, 10:04 AM
  6. [SOLVED] Creating a master from 2 seperate spreadsheets
    By katieshields in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 06-04-2013, 07:00 AM
  7. Creating a loop that will sort, copy, paste and save data into seperate workbooks
    By EggHead in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-14-2009, 03:17 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