+ Reply to Thread
Results 1 to 8 of 8

Trying to Shorten/Simplify some Code to Make it Easier to Apply To Other Workbooks

  1. #1
    Forum Contributor
    Join Date
    02-12-2018
    Location
    TX
    MS-Off Ver
    MS Office 2019
    Posts
    305

    Trying to Shorten/Simplify some Code to Make it Easier to Apply To Other Workbooks

    Perhaps I'm getting greedy. One of the forum contributors (Roel Jongman) was able to come up with a working solution to my slicer hiding problem (thanks again). But it's a bit of a mouthful code-wise and going forward I'm going to have a difficult time applying it to my current project as I start to add more things in...primarily due to my limited VBA knowledge. I'm wondering if there's a way to simplify it. Think the previous post was something along the lines of Dependent Slicers. Any help would be greatly appreciated. Tks.
    Attached Files Attached Files
    Last edited by Jim Clayton; 06-12-2018 at 10:56 AM.

  2. #2
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,010

    Re: Is it possible to simplify this? (VBA)

    .
    If you can "sort" all the data based on the MATERIAL column alone, then you could use the Excel built-in FILTER method located on the DATA tab.

    Here is an excellent "HOW TO" video that's only 8 minutes long : https://www.youtube.com/watch?v=EF9a5XuOu2w

    It doesn't get much easier than the FILTER.

  3. #3
    Forum Contributor
    Join Date
    02-12-2018
    Location
    TX
    MS-Off Ver
    MS Office 2019
    Posts
    305

    Trying to Shorten/Simplify some Code to Make it Easier to Apply To Other Workbooks

    Thanks for the reply. Unfortunately I don't think that this is an option for me. On many of the parts that I intend to load in the future, "Material" would be non-applicable, and which would mean that the slicer would need to hide. Which is one of my reasons for seeing if it's possible to simplify it. The code works great for the current workbook, but it makes adding any future hide-able slicers a little difficult. I'm able to follow/manipulate some coding, but this is rather lengthy and beyond the scope of my capabilities, so I'm hoping maybe it can be simplified.
    Last edited by Jim Clayton; 06-12-2018 at 10:57 AM.

  4. #4
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,010

    Re: Is it possible to simplify this? (VBA)

    .
    If you weren't going to use the SLICER approach ... is there anything in the existing database that you can 'search' on and return the data you require ?

    The reason I ask ... I have another project that allows you to search the entire sheet at once. For every letter or number you enter into the search field, it returns anything it can find
    with the letters / numbers in the order typed in. Hope that makes sense.

    Sorry I do not have any experience with SLICERS.

  5. #5
    Forum Contributor
    Join Date
    02-12-2018
    Location
    TX
    MS-Off Ver
    MS Office 2019
    Posts
    305

    Trying to Shorten/Simplify some Code to Make it Easier to Apply To Other Workbooks

    Hi thanks. I think I'm planning sticking with the slicers. This is my first time dealing with them as well,but I'm working on building a platform where users can have all of the components needed to assemble a BOM on CAD drawings. The slicers allow for all the components to be laid out like command buttons with sub categories for filtering and narrowing down to one option. Once you've made your choice,you add it to your BOM on the adjacent page. The problem is that not all components have the same filter information,so I'm trying to hide them when irrelevant. Roel Jongman came up with a way to do this,but it's difficult for me to apply to future applications. Tks.
    Last edited by Jim Clayton; 06-12-2018 at 10:57 AM.

  6. #6
    Forum Contributor
    Join Date
    02-12-2018
    Location
    TX
    MS-Off Ver
    MS Office 2019
    Posts
    305

    Trying to Shorten/Simplify some Code to Make it Easier to Apply To Other Workbooks

    Anyone else think they might be able to crack this one? Would greatly appreciate the help. Tks.
    Last edited by Jim Clayton; 06-12-2018 at 10:56 AM.

  7. #7
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Is it possible to simplify this? (VBA)

    Hello Jim & Welcome to the Forum,

    Administrative Note:
    • We would love to continue to help you with your query, but first, before we can proceed…
    • Please see Forum Rule #1 about proper thread titles and adjust accordingly...
    HTH
    Regards, Jeff

  8. #8
    Forum Contributor
    Join Date
    02-12-2018
    Location
    TX
    MS-Off Ver
    MS Office 2019
    Posts
    305

    Trying to Shorten/Simplify some Code to Make it Easier to Apply To Other Workbooks

    Making query adjustments as requested. To summarize. The attached workbook has slicers. I was trying to hide the irrelevant ones when not in use. One of the forum contributors (Roel Jongman) was able to come up with a working solution to my slicer hiding problem. It works great for THIS workbooks, but is difficult for me to apply to OTHER workbooks with more slicers due to my limited VBA knowledge. Wondering if there's a way to simplify it. Thanks everyone for your help. Let me know if anything further is needed.
    Attached Files Attached Files

+ 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. Simplify formula
    By SalamanderSam14 in forum Excel General
    Replies: 6
    Last Post: 01-04-2012, 12:23 PM
  2. Simplify formula
    By SalamanderSam14 in forum Excel General
    Replies: 1
    Last Post: 01-04-2012, 11:03 AM
  3. Simplify an IF function
    By GuF021 in forum Excel General
    Replies: 2
    Last Post: 12-16-2011, 08:32 PM
  4. Too Many If's - Help to simplify
    By batman1056 in forum Excel General
    Replies: 8
    Last Post: 12-07-2010, 12:19 PM
  5. possible to simplify?
    By xLiquidFlames in forum Excel General
    Replies: 1
    Last Post: 02-23-2009, 03:29 AM
  6. Simplify and add to IF
    By Mark K in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 08-24-2006, 06:13 AM
  7. Simplify
    By ccl28 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-15-2006, 05:50 AM
  8. [SOLVED] A way to simplify this please
    By Larry Empey in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-30-2006, 08:10 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