+ Reply to Thread
Results 1 to 3 of 3

Use VBA to higlight cells based on the demand covered by type of stock

  1. #1
    Registered User
    Join Date
    07-20-2022
    Location
    Mexico
    MS-Off Ver
    365, 2021
    Posts
    2

    Use VBA to higlight cells based on the demand covered by type of stock

    Hi everyone! I have a situation, I have three types of Stock: regular stock, stock that is on its way and ordered stock. I also have a certain demand for each material each day. So I'd like to see how many days the demand is covered by each kind of stock. When it is working properly it should look something like this:
    excel.png

    I'm not sure if it could be made through conditional formatting or if a VBA code would be needed, if the latter is required I was thinking to make the macro sum values until the amount of the first stock is reached and then color the cells or subtract each daily demand from the total stock. If someone could help me with that it's be amazing!
    Thanks beforehand and have a great day!

  2. #2
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,619

    Re: Use VBA to higlight cells based on the demand covered by type of stock

    You can use conditional formatting with rules based on formulas.
    I used orange instead of red for your last condition, and then red for the situation when the demand is not covered by, stock + on the way + already ordered
    See attached.

    By the way, if you want to use formatting also to not filled yet cells, you may consider more advanced formula
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    All conditional formatting rules were added having selected range with cell E3 in it's upper left corner.

    Note also that sequence of rules is important.
    Attached Images Attached Images
    Attached Files Attached Files
    Best Regards,

    Kaper

  3. #3
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,619

    Re: Use VBA to higlight cells based on the demand covered by type of stock

    PS. How about my answer to your previous post?

    https://www.excelforum.com/excel-pro...ml#post5701256

    Any comment? Did it work?

    BTW. Note yellow banner above concerning sample workbooks

+ 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. [SOLVED] How do I calculate my clothes dryer demand based on if my electric range has a demand
    By HaloMike in forum Excel - New Users/Basics
    Replies: 3
    Last Post: 12-23-2021, 07:31 PM
  2. Replies: 1
    Last Post: 05-21-2021, 05:49 PM
  3. Replies: 1
    Last Post: 02-21-2019, 11:19 AM
  4. [SOLVED] Working out replenishing levels from customer demand using a Maximum Stock level
    By pmw19800 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-25-2018, 09:02 AM
  5. How to do Demand Planning & stock forecast ?
    By anu0512 in forum Excel General
    Replies: 6
    Last Post: 01-08-2016, 06:31 AM
  6. Automating and sorting a stock demand spreadsheet
    By jasw529 in forum Excel General
    Replies: 4
    Last Post: 03-28-2013, 08:50 AM
  7. Fomula to calculate supply vs Demand - Stock
    By Achard in forum Excel Formulas & Functions
    Replies: 19
    Last Post: 09-17-2008, 02:13 PM

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