+ Reply to Thread
Results 1 to 11 of 11

Automatically filter and create pages

  1. #1
    Forum Contributor
    Join Date
    09-09-2009
    Location
    United States
    MS-Off Ver
    Excel 2003
    Posts
    185

    Automatically filter and create pages

    Hello again all!!!

    I found this beautiful piece of code just searching around:

    Please Login or Register  to view this content.
    I was wondering if there is a way to have this search and create multiple pages based off of more than one criteria. First though, it would need to find all of the different values in a column (the criteria) then be able to copy the data and create a page for each different criteria.

    Any help in advance would be awesome. I am going to try and figure this out but I am not sure if my abilities are capable.

    Thank you.
    Last edited by whatsmyname; 01-05-2014 at 04:18 PM.

  2. #2
    Valued Forum Contributor fredlo2010's Avatar
    Join Date
    07-04-2012
    Location
    Miami, United States
    MS-Off Ver
    Excel 365
    Posts
    762

    Re: Automatically filter and create pages

    hi,

    So you have one sheet and you want to filter in that page for all the items in column A and paste them in a newly created sheet? Also how big is the data. And why are you inserting a row?

    Thanks

  3. #3
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Automatically filter and create pages

    Quote Originally Posted by whatsmyname View Post

    I was wondering if there is a way to have this search and create multiple pages based off of more than one criteria. First though, it would need to find all of the different values in a column (the criteria) then be able to copy the data and create a page for each different criteria.

    Any help in advance would be awesome. I am going to try and figure this out but I am not sure if my abilities are capable.

    Thank you.
    If I follow what you're asking, try this...

    Please Login or Register  to view this content.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  4. #4
    Forum Contributor
    Join Date
    09-09-2009
    Location
    United States
    MS-Off Ver
    Excel 2003
    Posts
    185

    Re: Automatically filter and create pages

    Wow. That was fast and awesome. That works beautifully and exactly like I was hoping.

    Can I paste this data into an already existing sheet? I see where I can change which cell it pastes into.

    Or better yet. I have a "template" that this data will paste into. Can I have it create or copy that template to a new page and then paste the filtered data into each newly created template page?

    Sorry if that was to much to ask. But man that was fast and awesome. I want to learn VBA like that.

  5. #5
    Forum Contributor
    Join Date
    09-09-2009
    Location
    United States
    MS-Off Ver
    Excel 2003
    Posts
    185

    Re: Automatically filter and create pages

    Actually, this morning I did find one problem. Everything works like it is supposed to but for some reason on every new page it keeps the first line from the main data source that the code is pulling information from.

    I am trying to see if I can find the issue but I am having some trouble.

    Any help would be greatly appreciated.

    Thank you

  6. #6
    Forum Contributor
    Join Date
    09-09-2009
    Location
    United States
    MS-Off Ver
    Excel 2003
    Posts
    185

    Re: Automatically filter and create pages

    Never mind, I see why it keeps the first row now. Is there a way I could keep it from not saving the first row? Just in case I didn't need it.

  7. #7
    Forum Contributor
    Join Date
    09-09-2009
    Location
    United States
    MS-Off Ver
    Excel 2003
    Posts
    185

    Re: Automatically filter and create pages

    Okay so I figured out that this is the section of code that I need to change:

    Please Login or Register  to view this content.
    The problem I am having is that it is also copying the top row or the row that I do not need to copy. It is my header row. I only need to copy the rows after the first row. I have been trying but I am having some trouble. Anyone have any pointers or ideas?

  8. #8
    Forum Contributor
    Join Date
    09-09-2009
    Location
    United States
    MS-Off Ver
    Excel 2003
    Posts
    185

    Re: Automatically filter and create pages

    Quote Originally Posted by whatsmyname View Post
    Wow. That was fast and awesome. That works beautifully and exactly like I was hoping.

    Can I paste this data into an already existing sheet? I see where I can change which cell it pastes into.

    Or better yet. I have a "template" that this data will paste into. Can I have it create or copy that template to a new page and then paste the filtered data into each newly created template page?

    Sorry if that was to much to ask. But man that was fast and awesome. I want to learn VBA like that.
    I already figured this one out. All I needed to do was change and add a few lines of code:

    I changed this:
    Please Login or Register  to view this content.
    To this:
    Please Login or Register  to view this content.
    Thank you all though.
    Last edited by whatsmyname; 01-05-2014 at 03:29 PM.

  9. #9
    Forum Contributor
    Join Date
    09-09-2009
    Location
    United States
    MS-Off Ver
    Excel 2003
    Posts
    185

    Re: Automatically filter and create pages

    Quote Originally Posted by whatsmyname View Post
    Okay so I figured out that this is the section of code that I need to change:

    Please Login or Register  to view this content.
    The problem I am having is that it is also copying the top row or the row that I do not need to copy. It is my header row. I only need to copy the rows after the first row. I have been trying but I am having some trouble. Anyone have any pointers or ideas?
    Actually now that I look at it, I think this might be the section I need to work with to accomplish not copying the first row:

    Please Login or Register  to view this content.

  10. #10
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Automatically filter and create pages

    Try this...

    rngFilter.Offset(1).Copy

  11. #11
    Forum Contributor
    Join Date
    09-09-2009
    Location
    United States
    MS-Off Ver
    Excel 2003
    Posts
    185

    Re: Automatically filter and create pages

    That did it sir. Thank you very much. Man once you really start to think about things vba is really simple. It's just a matter of understanding the objects and how to work with them and how you can manipulate them.

    Here is the completed code working the way I am wanting it too:

    Please Login or Register  to view this content.
    Thank you very much sir!

+ 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. Replies: 4
    Last Post: 01-28-2013, 05:25 AM
  2. Replies: 0
    Last Post: 08-30-2012, 04:56 PM
  3. Excel 2007 : Show Report Filter Pages option- help
    By floricita in forum Excel General
    Replies: 0
    Last Post: 12-12-2011, 07:06 AM
  4. How to automatically filter can filter and blue-colored cells
    By ersoyalanprovus in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-21-2009, 01:20 PM
  5. How would I create a filter on many pages
    By thandlr in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-27-2007, 09:57 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