+ Reply to Thread
Results 1 to 13 of 13

Macro for advance filter to create separate worksheet and workbook based on criteria

  1. #1
    Registered User
    Join Date
    07-25-2014
    Location
    India
    MS-Off Ver
    2007 , 2010
    Posts
    9

    Macro for advance filter to create separate worksheet and workbook based on criteria

    Hi , I'm trying to create worksheet based on the criteria . It is creating the worksheet based on the criteria but it is not copying the data to respective worksheet
    . I want S.no also to arranaged correctly in all the worksheet . I have attached the sample workbook along with it .


    I also want to know whether it is possible to create workbook using this code by changing worksheet to workbook . Sorry if my question is stupd . i'm not good in Vba . I'm learning it

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by bossrockzz; 08-17-2014 at 04:07 PM.

  2. #2
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: Error in macro code!

    can you comment this part of code ? I don't understand the goal
    Please Login or Register  to view this content.
    can you attach a file with desired output ?
    Last edited by patel45; 08-16-2014 at 11:40 AM.
    If solved remember to mark Thread as solved

  3. #3
    Registered User
    Join Date
    07-25-2014
    Location
    India
    MS-Off Ver
    2007 , 2010
    Posts
    9

    Re: Error in macro code!

    It is to get column details for creating the worksheet with number column required . I'm sorry i'm so good in vba . It worked first for me but now it is showing break in code . I do not know how to retrieve it . Help me

  4. #4
    Registered User
    Join Date
    07-25-2014
    Location
    India
    MS-Off Ver
    2007 , 2010
    Posts
    9

    Re: Error in macro code!

    In column 2 you have the item list . Based on criteria i want to create worksheet (Like switch , socket etc) . In switch worksheet it contains the details about the switch alone with s.no arranged properly . This is what i'm trying to do

  5. #5
    Registered User
    Join Date
    07-25-2014
    Location
    India
    MS-Off Ver
    2007 , 2010
    Posts
    9
    Can anyone help me with this

  6. #6
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: Error in macro code!

    please attach a file with desired output

  7. #7
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Error in macro code!

    hi bossrockzz, your workbook and code with slight modifications.

    Changing worksheet to workbook would require other changes in the code as well.
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    07-25-2014
    Location
    India
    MS-Off Ver
    2007 , 2010
    Posts
    9
    Thank you so much watersev . But can you tell how to make it create the workbook . I mean the changes in the code to create workbook based criteria

  9. #9
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,890

    Re: Error in macro code!

    Your post does not comply with Rule 1 of our Forum RULES. Your post title should accurately and concisely describe your problem, not your anticipated solution.

    Use terms appropriate to a Google search. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will be addressed according to the OP's experience in the forum: If you have less than 10 posts, expect (and respond to) a request to change your thread title. If you have 10 or more posts, expect your post to be locked, so you can start a new thread with an appropriate title.

    To change a Title go to your first post, click EDIT then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.

    (This thread should receive no further responses until this moderation request is fulfilled, as per Forum Rule 7)
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  10. #10
    Registered User
    Join Date
    07-25-2014
    Location
    India
    MS-Off Ver
    2007 , 2010
    Posts
    9
    Sorry alansidman . I have changed the title . Tell what changes has to done to make the code create both worksheet and workbook based on criteria

  11. #11
    Registered User
    Join Date
    07-25-2014
    Location
    India
    MS-Off Ver
    2007 , 2010
    Posts
    9

    Re: Macro for advance filter to create separate worksheet and workbook based on criteria

    It should be based on two criteria . Based on criteria 1 it creats workbook . In that workbook based on criteria 2 it creates worksheets.

  12. #12
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: Error in macro code!

    Quote Originally Posted by patel45 View Post
    can you comment this part of code ? I don't understand the goal
    Please Login or Register  to view this content.
    can you attach a file with desired output ?
    I'm waiting for desired output

  13. #13
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: Macro for advance filter to create separate worksheet and workbook based on criteria

    Hi, bossrockzz,

    first of all you would need to explain why your range for the unique list should start at row 1 whgen I assume you would do better if you start a row 6 with the header and copy it to the first row in the last ciolumn,. And your loop regarding the names should skip the Header and start in row 2 to loop through the uniques. The criteria I undertsand should be that in COlumn A so you would need to extract that data and apply the filter to that column.

    Maybe try
    Please Login or Register  to view this content.
    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

+ 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. Error In Macro Code
    By greenfalcon in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-12-2013, 10:00 PM
  2. [SOLVED] Error in code run a macro once a day
    By mukeshbaviskar in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 06-26-2013, 10:44 PM
  3. Autofilter Macro Failing - Run-time error 91 - full macro code is attached
    By evamarie in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-07-2013, 02:36 PM
  4. Macro code error: code is near complete
    By kashshaikh in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-17-2011, 03:22 PM
  5. Macro code error
    By marshall23 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-05-2011, 03:30 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