+ Reply to Thread
Results 1 to 12 of 12

VBA Macro to Filter with Input box, Split files, Convert into Excel Table and Sort

  1. #1
    Forum Contributor
    Join Date
    02-07-2013
    Location
    Karachi, Pakistan
    MS-Off Ver
    Excel 2007
    Posts
    290

    VBA Macro to Filter with Input box, Split files, Convert into Excel Table and Sort

    Hello,
    Good day everyone. Hope you guys are doing great.

    I am looking for a vba based solution for the subject mentioned tasks. (almost novice in vba)

    I found this code (sheet attached) somewhere on the web, it works find but I need some modification and I hope you guys will help.


    Modifications required:

    1) Instead of this hard coded range, we need an input box to enter column name (eg: "A")

    Please Login or Register  to view this content.
    2) Before saving we need in each file, Convert the data into Excel Table and add a Total row and sum formula in column E (Table total row).


    3) Sort Column E (Largest to smallest)

    Any or all help is appreciated.

    Regards,
    Attached Files Attached Files
    Khalid

  2. #2
    Forum Expert
    Join Date
    08-16-2015
    Location
    Antwerpen, Belgium
    MS-Off Ver
    2007-2016
    Posts
    2,380

    Re: VBA Macro to Filter with Input box, Split files, Convert into Excel Table and Sort

    Change first part to

    Please Login or Register  to view this content.
    Kind regards
    Leo

  3. #3
    Forum Expert
    Join Date
    08-16-2015
    Location
    Antwerpen, Belgium
    MS-Off Ver
    2007-2016
    Posts
    2,380

    Re: VBA Macro to Filter with Input box, Split files, Convert into Excel Table and Sort

    Compleet

    Please Login or Register  to view this content.
    Kind regards
    Leo

  4. #4
    Forum Contributor
    Join Date
    02-07-2013
    Location
    Karachi, Pakistan
    MS-Off Ver
    Excel 2007
    Posts
    290

    Re: VBA Macro to Filter with Input box, Split files, Convert into Excel Table and Sort

    Hi Leo,
    Thanks for the help.

    I am having error:
    Screen shots attached.

    at the following:
    Please Login or Register  to view this content.
    Regards,
    Attached Images Attached Images

  5. #5
    Forum Expert
    Join Date
    08-16-2015
    Location
    Antwerpen, Belgium
    MS-Off Ver
    2007-2016
    Posts
    2,380

    Re: VBA Macro to Filter with Input box, Split files, Convert into Excel Table and Sort

    I forgot to remove that line, you dont need it


    Kind regards
    Leo

  6. #6
    Forum Contributor
    Join Date
    02-07-2013
    Location
    Karachi, Pakistan
    MS-Off Ver
    Excel 2007
    Posts
    290

    Re: VBA Macro to Filter with Input box, Split files, Convert into Excel Table and Sort

    Hi Leo,
    It works like a magic

    I will check this on complete file on Monday, and will give my feedback.

    Really appreciate your help.
    Blessing to you,

    Khalid

  7. #7
    Forum Contributor
    Join Date
    02-07-2013
    Location
    Karachi, Pakistan
    MS-Off Ver
    Excel 2007
    Posts
    290
    Hi Leo,
    Good day.

    My colleagues are much happy with your solution.
    Thakns for your help.

    Just a follow up question:
    Is it possible to add one more inputbox for the sorting?
    I mean we can enter the column name in inputbox and it will sort all the files based on inputbox?

    Appreciate if you could help on this too.

    With regards,
    Khalid

  8. #8
    Forum Expert
    Join Date
    08-16-2015
    Location
    Antwerpen, Belgium
    MS-Off Ver
    2007-2016
    Posts
    2,380

    Re: VBA Macro to Filter with Input box, Split files, Convert into Excel Table and Sort

    So 1 inputbox for Column to create the Files
    and 1 inputbox to say on witch Column to sort

    and in inputbox the columnheaders or A,B,C ..... ?

    Kind regards
    Leo

  9. #9
    Forum Contributor
    Join Date
    02-07-2013
    Location
    Karachi, Pakistan
    MS-Off Ver
    Excel 2007
    Posts
    290
    Hi Leo

    Yes exactly, you have already helped for the fist inputbox, which is working great.
    Need 2nd inputbox for sorting on columns before saving each file. 2nd inputbox can be any type of, e.g: A,B,C or table header name e.g: name, b.assigned etc. Whichever is possible.

    I think A,B,C will be much easier for user.

    Many thanks,
    Khalid
    Last edited by Khalidngo; 03-13-2017 at 11:06 PM.

  10. #10
    Forum Expert
    Join Date
    08-16-2015
    Location
    Antwerpen, Belgium
    MS-Off Ver
    2007-2016
    Posts
    2,380

    Re: VBA Macro to Filter with Input box, Split files, Convert into Excel Table and Sort

    Try this and let me know

    Please Login or Register  to view this content.
    Kind regards
    Leo

  11. #11
    Forum Contributor
    Join Date
    02-07-2013
    Location
    Karachi, Pakistan
    MS-Off Ver
    Excel 2007
    Posts
    290

    Re: VBA Macro to Filter with Input box, Split files, Convert into Excel Table and Sort

    Hi Leo,

    That works great on the sample. I am sure it will work the same way on my actual file, I will test tomorrow and will let you know.

    Many thanks and have a good day.

    Regards,

    Khalid

  12. #12
    Forum Contributor
    Join Date
    02-07-2013
    Location
    Karachi, Pakistan
    MS-Off Ver
    Excel 2007
    Posts
    290

    Re: VBA Macro to Filter with Input box, Split files, Convert into Excel Table and Sort

    Hi Leo,

    I have tried on my actual file and it works like a dream

    Please accept my sincere gratitude for your help.

    God bless you.

    Regards,

    Khalid

+ 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. VBA/macro to split an excel file into multiple files with 500 lines each
    By karambos3 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-11-2023, 12:43 PM
  2. Need to convert .ods files into .xlsx using excel macro
    By ranjita_bls in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-24-2015, 06:15 AM
  3. Convert multiple word files to one excel table
    By Barefaced in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-17-2014, 04:52 AM
  4. Excel Macro to convert list of files to pdf
    By nandu05 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-05-2013, 12:52 AM
  5. How to convert XML files into an EXCEL table (rows)?
    By pstein in forum Excel General
    Replies: 0
    Last Post: 01-10-2013, 03:48 AM
  6. Excel 2010 Macro -how to split worksheet into multiple files
    By kbustin in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-01-2012, 10:39 AM
  7. User Input to Split the Table
    By rakesh1 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-19-2010, 08:11 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