Results 1 to 6 of 6

Need help with a VBA code for distributing data

Threaded View

  1. #1
    Registered User
    Join Date
    11-17-2014
    Location
    panama
    MS-Off Ver
    2013
    Posts
    2

    Need help with a VBA code for distributing data

    Hello,


    I got a work project that requires me to create several documents out one Master Document.

    Here's the problem, the master document has filter cell, which I need in order to filter the massive amount of data and then create a new document with only the filtered data. The problem is that I have to create a large amount of those new documents, and copy-pasting will take forever. I thought I had solved the problem by copying the master sheet several times and then filtering the information on each sheet (each sheet has different filters) and then using the code below to make every sheet into a new document. This seem like a viable solution until I realized it copies the complete data but only showed the filtered data.




    Sub Splitbook()
    Dim xPath As String
    xPath = Application.ActiveWorkbook.Path
    Application.ScreenUpdating = False
    Application.DisplayAlerts = False
    For Each xWs In ThisWorkbook.Sheets
    xWs.Copy
    Application.ActiveWorkbook.SaveAs Filename:=xPath & "" & xWs.Name & ".xls"
    Application.ActiveWorkbook.Close False
    Next
    Application.DisplayAlerts = True
    Application.ScreenUpdating = True
    End Sub


    What I need is a code that will copy the filtered data WITHOUT the master data and create a new doc with only the filtered data.

    Example. (Bold means that the data can be filtered)


    A1 A2 A3 A4 B1 B2 B3 B4 C1 C2 C3 C4 ( MASTER DATA)

    A1 A3 A4 B1 B3 B4 C1 C3 C4 (FILTERED DATA - AL CELLS CONTAINING "2" ARE NOT SHOWN)

    A1 A3 A4 B1 B3 B4 C1 C3 C4 (NEW DOWCUMENT)

    The new document will only contain the filtered data. Not the master data filtered.



    Thanks in advance.
    Last edited by cspeid03; 12-21-2016 at 05:05 PM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Distributing values or data with a group???
    By FifiNguyen in forum Excel General
    Replies: 0
    Last Post: 03-01-2014, 03:46 AM
  2. Distributing data from one column to multiple
    By MechanicalFrito in forum Excel General
    Replies: 1
    Last Post: 08-20-2012, 01:18 PM
  3. Distributing Excel VBA code
    By excelbobabc in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-08-2011, 09:48 PM
  4. Distributing data in different worksheets with Macros
    By robertse in forum Excel General
    Replies: 2
    Last Post: 06-02-2010, 01:29 PM
  5. Distributing Data
    By Milnet in forum Excel General
    Replies: 6
    Last Post: 08-10-2009, 02:55 AM
  6. distributing data into multiple cells
    By jaspreet in forum Excel General
    Replies: 1
    Last Post: 05-28-2005, 04:31 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