Excel Vba

  • i wish to know if someone could help me with a vba code which updates a group of five cells based on its minimum level automatically

    1.} So DOCK8 has a capacity of 48 , so everytime its corresponding ( on the same row) "census cell " HAS A VALUE < 48 its " status cell" will appear in "color green" with text " surge 0" on it

    otherwise if census cell value is above 48 , its corresponding "status cell "will appear in "YELLOW" with text " surge 1" on it


    2.) For DOCK9 will be the same procedure as B8


    3.)For DOCK10 the capacity is 12 so when "census cell" value is < 12, its corresponding status cell value appears in yellow with text " Surge 1 ongoing" and when its census value is > 12 cell colour changes to red with textin cell "surge 3"


    4.) For DOCK11 the capacity is 6 so when "census cell" value is < 6, its corresponding status cell value appears in red with text " Surge 2 ongoing" and when its census cell value is > 6 cell colour changes to red with text in cell "surge 3"

    Bed Status and Discharge Planning
    docking Unit Available pallets Census leaving coming in Status
    Definite Likely
    DOCK8
    DOCK9
    DOCK10
    DOCK11
    Total
  • Your title should suggest your problem. After all, you're in an Excel VBA site so a tile like "Excel VBA" suggests to just skip this post.

    There is also a way to attach a workbook so the helpers can try out the code. It is pretty hard to try code on a picture.

  • Hey Roy, i did try conditional formatting but with that ill have to highlight the cells myself , while with VBA depending on the value entered which updates everyday, the color might or might not change based on the limit .


    Here i made a workbook but its more or less the same like the table whatever value is entered in the census cell updates the status cell corresponding

    i highlighted the cells in question on the workbook

    ThanksBook1.xlsx