+ Reply to Thread
Results 1 to 2 of 2

Format cells based on condition

  1. #1
    Registered User
    Join Date
    09-02-2010
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    10

    Format cells based on condition

    I would like to insert a series of shaded cells based on the number in another cell.
    In the attached spreadsheet you will notice a number in cell B21, to the right begining at B4 and going to H6 you will find the series of cells in reference. I would like these referenced or group of cells be entered the number of times that B21 has referenced. 1 group of cells if the number 1 is entered into B21, 2 sets of grouped cells if the number 2 is enter into B21 ect. up to 6 times
    I have number 4 entered into B21 on the attached sheet1 and number 2 entered into B21 on sheet2 so you can see how it needs to be layed out.
    I am not a VBA writer.
    Any help on this would be greatly appreciated.
    Thanks in advance
    Keith
    Attached Files Attached Files

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Format cells based on condition

    Hi Keith,

    I'd be inclined to use Conditional Formatting using an IF() function.

    Using say J12 as an example, set the background to no colour and the font to white with the Conditional format formula =B21<3

    At the same time in the cells where you have Start and Break use a similar IF statement along the lines of in say J12, =IF(B21>=3,"Start","")

    Apply the same logic to all the grouped cells referencing B21 in each case and changing the test value in the IF test

    HTH
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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