+ Reply to Thread
Results 1 to 19 of 19

Macro to select multiple categories and percentages.

  1. #1
    Registered User
    Join Date
    03-15-2011
    Location
    Rio Rancho, NM
    MS-Off Ver
    Excel 2010
    Posts
    21

    Macro to select multiple categories and percentages.

    Hello

    I have a macro project that needs some adjustments. The first attached spreadsheet (Carve-Out) has a pdf, results, data, and list tab. There is a macro built-in to the purple button, that allows the user to choose up to three categories, and would copy from the data tab and paste into the results tab. This was set-up so that only one percentage could be selected.

    The first spreadsheet works great (thank you MarvinP), however, I need to be able to select up to eight categories all with different percentages as seen in the Carve-Out 2 file. So the end user would select up to eight categories, select different percentages for each category, click on the purple button, and have everything populate below. The % for proposal would be the 2011 Medicare number * the percentage chosen.

    Any help on this would be greatly appreciated.

    Thank you.
    Attached Files Attached Files
    Last edited by rygon8; 04-07-2011 at 12:17 PM.

  2. #2
    Registered User
    Join Date
    03-15-2011
    Location
    Rio Rancho, NM
    MS-Off Ver
    Excel 2010
    Posts
    21

    Re: Macro to select multiple categories and percentages.

    Update.

    I believe I got the code to select up to the eight categories, if someone could double-check my modified code that would be appreciated. So now I'm stuck on the other half of having to select different percentages for each category. The category selected in B2 corresponds to % selected in cell E2 (results tab).

    % for proposal = 2011 Medicare Value * % selected

    Thank you.
    Attached Files Attached Files

  3. #3
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Macro to select multiple categories and percentages.

    Hi rygon8
    Just trying to understand. If 2011 Medicare Value = 10% off MSRP and % selected were 110% what would % for proposal look like in this formula
    % for proposal = 2011 Medicare Value * % selected
    I get
    % for proposal = 10% off MRSP * 110%
    but I don't know what that evaluates to.
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

  4. #4
    Registered User
    Join Date
    03-15-2011
    Location
    Rio Rancho, NM
    MS-Off Ver
    Excel 2010
    Posts
    21

    Re: Macro to select multiple categories and percentages.

    Quote Originally Posted by jaslake View Post
    Hi rygon8
    Just trying to understand. If 2011 Medicare Value = 10% off MSRP and % selected were 110% what would % for proposal look like in this formulaI get but I don't know what that evaluates to.
    Hi John,

    Those particular items will be manually calculated by the end user. Sorry for any confusion there, but yes that would be the formula for the % for proposal.

  5. #5
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Macro to select multiple categories and percentages.

    Hi rygon8
    If a procedure were to apply the formula, it'll return "#VALUE!". What do you wish the procedure to return?

  6. #6
    Registered User
    Join Date
    03-15-2011
    Location
    Rio Rancho, NM
    MS-Off Ver
    Excel 2010
    Posts
    21

    Re: Macro to select multiple categories and percentages.

    Quote Originally Posted by jaslake View Post
    Hi rygon8
    If a procedure were to apply the formula, it'll return "#VALUE!". What do you wish the procedure to return?
    Hi

    If it returns the "#VALUE!", can we have it default to say "manually calculated" in the % for proposal ? Or should I remove those items from the data set and add them in later ?

  7. #7
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Macro to select multiple categories and percentages.

    Hi rygon8
    This code is in the attached
    Please Login or Register  to view this content.
    I've changed a few lines of code in your original procedure and added lines to do the math. Step through the code to see what it's doing. I see an issue if a user populates B2, leaves B3 blank and populates B4 (try it, you'll se what I mean). This can be handled if you like. Let me know of issues.
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    03-15-2011
    Location
    Rio Rancho, NM
    MS-Off Ver
    Excel 2010
    Posts
    21

    Re: Macro to select multiple categories and percentages.

    Hi John,

    This is amazing! Thank you. For the F13 cell (results tab), is there anyway to leave the header as "% for proposal" without drastic changes to the code ? Yes, I do see what you mean if a user populates B2 and leaves B3 blank, is this fixable ? Please let me know.

    Many Thanks.

  9. #9
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Macro to select multiple categories and percentages.

    Hi rygon8
    Ha! I see what you mean
    is there anyway to leave the header as "% for proposal"
    I do set it back here
    Please Login or Register  to view this content.
    but overwrite it here
    Please Login or Register  to view this content.
    Sorry 'bout that...didn't notice it. Easy fix.

    Regarding this
    I do see what you mean if a user populates B2 and leaves B3 blank, is this fixable ?
    Yes, i think it's fixable. I have a personal project that has similar requirements...I'll adapt the code from there. Get back to you on this.

  10. #10
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Macro to select multiple categories and percentages.

    Hi rygon8
    Fixed this
    is there anyway to leave the header as "% for proposal"
    Think I fixed this
    I do see what you mean if a user populates B2 and leaves B3 blank, is this fixable ?
    Try it...let me know of issues.
    Attached Files Attached Files

  11. #11
    Registered User
    Join Date
    03-15-2011
    Location
    Rio Rancho, NM
    MS-Off Ver
    Excel 2010
    Posts
    21

    Re: Macro to select multiple categories and percentages.

    Hi John

    This works perfectly, I really appreciate the work you did for this. Looking at the code, I think it's clear I was not going to be able to accomplish this on my own.

    Thank you.

  12. #12
    Registered User
    Join Date
    03-15-2011
    Location
    Rio Rancho, NM
    MS-Off Ver
    Excel 2010
    Posts
    21

    Re: Macro to select multiple categories and percentages.

    Hi John

    I may have found a potential problem. I have attached the most recent spreadsheet, the way it is currently set the user cannot change the %, on cell E2. It says "the preceding row can't be left empty". Also, if I only select one category, I think the code gets caught in a loop?

    Let me know if any of this is fixable.

    Thank you.
    Attached Files Attached Files
    Last edited by rygon8; 04-06-2011 at 12:55 PM.

  13. #13
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Macro to select multiple categories and percentages.

    Hi rygon8
    See if this version resolves both issues for you. Let me know of issues.
    Attached Files Attached Files

  14. #14
    Registered User
    Join Date
    03-15-2011
    Location
    Rio Rancho, NM
    MS-Off Ver
    Excel 2010
    Posts
    21

    Re: Macro to select multiple categories and percentages.

    Yes, this is great.

    Thank you.

  15. #15
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Macro to select multiple categories and percentages.

    You're welcome. Let me know if something else comes up.

  16. #16
    Registered User
    Join Date
    03-15-2011
    Location
    Rio Rancho, NM
    MS-Off Ver
    Excel 2010
    Posts
    21

    Re: Macro to select multiple categories and percentages.

    Hi John

    One more slight issue, the first calculation for the % for proposal (cell F14). Always calculates as manually calculated. Let me know of any possible solution.

    Thanks.
    Attached Files Attached Files

  17. #17
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Macro to select multiple categories and percentages.

    Hi rygon8
    I think we have it surrounded...keep pounding on it...see if you can break it. This version seems to have this issue resolved
    the % for proposal (cell F14). Always calculates as manually calculated
    Sorry I didn't notice that.
    Attached Files Attached Files

  18. #18
    Registered User
    Join Date
    03-15-2011
    Location
    Rio Rancho, NM
    MS-Off Ver
    Excel 2010
    Posts
    21

    Re: Macro to select multiple categories and percentages.

    Hi John

    I can't break this version. All of the issues have been resolved.

    Thanks again.

  19. #19
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Macro to select multiple categories and percentages.

    Good to hear. You're welcome.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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