+ Reply to Thread
Results 1 to 6 of 6

Conditional layout only on a specific part of a cell

  1. #1
    Registered User
    Join Date
    04-26-2014
    Location
    Leuven, België
    MS-Off Ver
    Excel for Mac 2011
    Posts
    44

    Conditional layout only on a specific part of a cell

    Hello,

    I know how conditional layout works and have used it with success in the past. I'm now stuck with a problem, but I'm not sure if there's a solution at all! If so, I hope you guys know it and I'll be forever thankful.

    Ok, here's the thing. I have several cells in my excel file that, through a formula, return a value. This value may or may not contain the '+'-character. So basically, just a +, or a plus-sign (I added the parenthesis for clarity).

    I'd like the + to be superscript. It's not part of a mathematical formula (as in 3+6), it's part of a string (as in ret^+, just a way we label things). So basically, I want some kind of conditional layout on the cell that says if it contains a plus, superscript the plus (but not the rest of the cell). A cell will at most contain one plus.

    No idea how to do this... Is there a solution at all?

    Thanks in advance!

    Denis
    Last edited by HosteDenis; 05-29-2014 at 08:45 PM.

  2. #2
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: Conditional layout only on a specific part of a cell

    If you're looking for a formula that will format part of a cell...Then, No.
    You'd need to use VBA to effect the formatting changes.
    Ron
    Former Microsoft MVP - Excel (2006 - 2015)
    Click here to see the Forum Rules

  3. #3
    Valued Forum Contributor Saarang84's Avatar
    Join Date
    02-19-2009
    Location
    Chennai, India
    MS-Off Ver
    XL 2003 to 2010
    Posts
    812

    Re: Conditional layout only on a specific part of a cell

    Hi Denis,

    Is this what you need ?

    Say, if cells A2 and A3 contains A+BCD+FDF+ and 123+233+ respectively, then the below formula (when used in both cells) gives you the output as +ABCDFDF and +123233 respectively.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    If my assistance has helped, there is a reputation icon * on the left hand corner below the post - you can show your appreciation to the user who has helped in resolving your requirement.

    If your requirement has been solved please mark your thread as Solved.
    In the menu bar above the very first post, select Thread Tools, then select "Mark this thread as Solved".

    Kindly use [FORMULA] or [CODE] tags when posting your code.

    Regards,
    Sarang

  4. #4
    Registered User
    Join Date
    04-26-2014
    Location
    Leuven, België
    MS-Off Ver
    Excel for Mac 2011
    Posts
    44

    Re: Conditional layout only on a specific part of a cell

    Hi Ron, that's what I was afraid of, but you can't blame me for asking here and hoping there might be a way!

    Saarang, not exactly. What I'm looking for is, if a cell contains the value ret+ or ed+ or 7b+, I want it to show as ret+ or ed+ or 7b+, with the plus character now in superscript (higher position).

    I hope this clarifies it, while typing my previous post I didn't realise I could add superscript to my forum posts.

    Denis

  5. #5
    Registered User
    Join Date
    04-26-2014
    Location
    Leuven, België
    MS-Off Ver
    Excel for Mac 2011
    Posts
    44

    Re: Conditional layout only on a specific part of a cell

    Does anyone have an idea? I still haven't figured it out myself, I'm thinking there might not be a way, but I haven't heard a decisive no either so...

  6. #6
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: Conditional layout only on a specific part of a cell

    Here's one approach:
    • Select your workbook
    • ALT+F11...to open the VBA Editor
    • Insert.Module...to add a general module to your workbook
    • Copy the below VBA code and paste it into that module
    Please Login or Register  to view this content.
    • Select the range you want edited in your workbook
    • ALT+F8...to open the macros window
    ...Select: PutSuper...Click: Run

    Now the + in each ret+, ed+, and 7b+ will be superscripted.
    Note: That code assumes that each of those values can only exist ONCE per cell.

    Is that something you can work with?

+ 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] Lookup for a specific part of a cell
    By oozden in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 03-08-2014, 05:19 AM
  2. [SOLVED] Count specific/part of a text in a cell
    By par0016 in forum Excel General
    Replies: 6
    Last Post: 10-05-2012, 10:34 AM
  3. Find specific text in part of a cell
    By woogster in forum Excel General
    Replies: 4
    Last Post: 03-15-2011, 11:58 AM
  4. Show specific part of a cell
    By VegasL in forum Excel General
    Replies: 5
    Last Post: 10-05-2010, 03:00 PM
  5. Replacing Specific part in a cell
    By sjanaswamy in forum Excel General
    Replies: 1
    Last Post: 08-23-2006, 04:26 PM

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