+ Reply to Thread
Results 1 to 6 of 6

Change a cell manually, by code and by scrollbar

  1. #1
    Registered User
    Join Date
    11-18-2022
    Location
    Netherlands
    MS-Off Ver
    Microsoft Office 365
    Posts
    3

    Lightbulb Change a cell manually, by code and by scrollbar

    Hi everyone,

    I am creating an excel model to calculate CO2 emissions from certain production processes. I want to make it possible for users of the model to alter ingoing materials into the system (by changing their percentages). I want different options of changing the cell values. Example:

    material A: 20%
    material B: 40%
    material C: 40%

    Option 1: select a 'product' (which means a prefabricated division of percentages) e.g. product 1 has A=20%, B=40%, C=40% and product 2 has A=30%, B=50%, C=20% and so on...
    I achieved this by making a table with all products (1,2 3 ..) with their according material percentages. I used the SUMIF function to refer to the table and then I linked this to a dropdown menu. So in the dropdown menu you can select product (1,2 or 3 etc.) and then the corresponding percentages will appear.

    Option 2: Manually enter a value. This is where the first problem arises.. Because after you manually changed the cell once, the formula in the cell disappears, which means that after that you cannot use Option 1 anymore (the dropdown menu).


    Option 3: I also want to add a scroller. So that instead of manually filling in the cell values, the user can also play around with the percentages by using scrollers. Is it possible to make 3 scrollers that are linked to 3 cells and that they together cannot exceed 100% and will change accordingly?



    So in summary: I want cells that can change by different input options, WITHOUT comprimisng the other option of input via:
    1. dropdownmenu + SUMIF function
    2. manually
    3. using a several scrollbars all linked to 1 cell (in a way that the combination of percentages do not exceed 100%)


    I hope I was able clearly address what I am trying to achieve.
    I find myself searching the internet but I haven't found a solution. Probably I am just using the wrong search terms or something..
    I would really appreaciate it if someone can lead me in the right direction!

  2. #2
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,640

    Re: Change a cell manually, by code and by scrollbar

    Hi there,

    What you want can almost certainly be done, but you have a much better chance of receiving meaningful assistance if you can let us see what your input worksheet looks like (a sample workbook NOT a screenshot!). It's much easier for us to "play" with something you've already created rather than to try to recreate it based on your description.

    Regards,

    Greg M

  3. #3
    Registered User
    Join Date
    11-18-2022
    Location
    Netherlands
    MS-Off Ver
    Microsoft Office 365
    Posts
    3

    Re: Change a cell manually, by code and by scrollbar

    Quote Originally Posted by Greg M View Post
    Hi there,

    What you want can almost certainly be done, but you have a much better chance of receiving meaningful assistance if you can let us see what your input worksheet looks like (a sample workbook NOT a screenshot!). It's much easier for us to "play" with something you've already created rather than to try to recreate it based on your description.

    Regards,

    Greg M
    Hi Greg M, Thanks for your reply! Indeed a good point. I made an example excel file, I hope this is sufficient.

    Kind regards
    Attached Files Attached Files

  4. #4
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,640

    Re: Change a cell manually, by code and by scrollbar

    Hi again,

    Take a look at the attached version of your workbook and see if it gets you moving in the right direction.

    The worksheet contains cells for your "predefined" values (i.e. from the dropdown list), cells for manual data entry if required, and a facility to adjust the actual percentages by using scrollbars. Non-zero values entered manually will take precedence over the "predefined" values.

    Hope this helps - please let me know how you get on.

    Regards,

    Greg M
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    11-18-2022
    Location
    Netherlands
    MS-Off Ver
    Microsoft Office 365
    Posts
    3

    Re: Change a cell manually, by code and by scrollbar

    Hi Greg,

    Wow this is awesome! Yes this is exactly what I was looking for thank you very much! I see the formula you used in the actual percentages. Brilliant solution, it looks so simple but I would have never thought of that. I will immediately throw this in my model thank you again for resolving this issue!!

    Kind regards

  6. #6
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,640

    Re: Change a cell manually, by code and by scrollbar

    Hi again,

    Many thanks for your feedback and also for the Reputation increase - much appreciated!

    You're welcome - glad I was able to help.

    Best regards,

    Greg M

+ 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. Change cell manually and by formula.
    By cktoo in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-16-2021, 03:25 AM
  2. [SOLVED] Change cell text with Scrollbar list
    By zplugger in forum Excel General
    Replies: 3
    Last Post: 10-29-2015, 01:22 PM
  3. [SOLVED] Event Change code to protect formula if data entered manually
    By Chron6767 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-03-2014, 06:52 PM
  4. Replies: 9
    Last Post: 08-30-2013, 07:49 AM
  5. [SOLVED] Using a cell-linked text box to detect a calculated cell change and set value of scrollbar
    By darwin003 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-13-2013, 08:29 PM
  6. Change ScrollBar Max value when a second ScrollBar vale is changed?
    By Jon Henry in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-11-2013, 06:47 PM
  7. Replies: 1
    Last Post: 07-13-2010, 03:15 AM

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