+ Reply to Thread
Results 1 to 7 of 7

conditional formatting using IF with MID functions

Hybrid View

  1. #1
    Registered User
    Join Date
    11-20-2007
    Posts
    4

    conditional formatting using IF with MID functions

    okay, I have a sheet with a bunch of skus, ie "MCREADER". If i have none in stock, I want it to be red. I will indicate that I have none in stock by putting a zero as the first character. So the sku would then be "0 MCREADER".

    Now, I select that cell "C11" in this case. Go up to conditional formatting. And use the formula:

    Code:
    ="IF(MID(C11, 1, 1) = 0)"
    Select the background to be red.

    But nothing happens. Is there something wrong with my formula.

    Also, how would apply this to all the cells on the sheet. How do i copy & paste the conditional formatting to apply for all the cells, that i set up for that one cell.

    If there's a better way to do this, please let me know.
    thanks for any help in advance.

  2. #2
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Maybe

    =MID(C11, 1, 1) = "0"
    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  3. #3
    Registered User
    Join Date
    11-20-2007
    Posts
    4
    so that worked, but how do I copy & paste that conditional format to all the cells?

    so A1 would have A1 in the formula, B2 would have B2, etc.

  4. #4
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    =MID(A1, 1, 1) = "0"
    #

    VBA Noob

  5. #5
    Registered User
    Join Date
    11-20-2007
    Posts
    4
    I tried this and it gave me an error in the formula.

    =IF(MID(#, 1, 1) = "0", TRUE)
    So basically, I need the symbol for the cell value to instert where I have the "#"

  6. #6
    Forum Contributor
    Join Date
    10-30-2007
    Location
    Norway
    MS-Off Ver
    MS Office 2007
    Posts
    345
    You can copy and paste conditional formating by using "paste special" and select "Formats" from the paste special menu.

+ 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