+ Reply to Thread
Results 1 to 10 of 10

Highlighting Conditional Character Count

  1. #1
    Forum Contributor
    Join Date
    02-13-2013
    Location
    Columbia, SC
    MS-Off Ver
    Excel 2010
    Posts
    217

    Highlighting Conditional Character Count

    I have sent text to columns such as in A1 we have:

    Hey my name is Bob and then it spreads each word out such that B1 = Hey, C1 = my, D1 = name and etc.

    I then need to do a character count over the range of cells and I need to highlight the cell that goes over 10 characters.

    So in this case, the cell with "name" in it will be highlighted since it goes over the character limit. It goes over the limit because Hey has 3 characters but I also need to account for a space, my has 2 + 1 space, and then name > 10. I need to do this to all of the cells in column A until A has no more data and over all of the worksheets.

    Does that make sense? Can anyone help?
    Last edited by bjcowen9000; 02-18-2013 at 04:00 PM.

  2. #2
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Highlighting Conditional Character Count

    Hi BJ,

    Try this:

    Please Login or Register  to view this content.
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  3. #3
    Forum Contributor
    Join Date
    02-13-2013
    Location
    Columbia, SC
    MS-Off Ver
    Excel 2010
    Posts
    217

    Re: Highlighting Conditional Character Count

    I have 2 questions about the code:

    I do not want the concatenated cell to be highlighted. I want the cell in the text to columns to be highlighted that violates character count

    1)Can it be changed in a way as such: AG contains the concatenated text of W:AF and I want the cell that goes above 31 characters in between W and AF to be highlighted?
    Last edited by bjcowen9000; 02-18-2013 at 04:47 PM.

  4. #4
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Highlighting Conditional Character Count

    Just change

    Please Login or Register  to view this content.
    To

    Please Login or Register  to view this content.
    to not highlight the concatenated cell.

    Do you want to deconcatenate AG backwards?

  5. #5
    Forum Contributor
    Join Date
    02-13-2013
    Location
    Columbia, SC
    MS-Off Ver
    Excel 2010
    Posts
    217

    Re: Highlighting Conditional Character Count

    Ok so here is a more elaborate picture: I have text in column E that I send to columns from W to AF (If it needs to go all the way to AF it can but it normally doesn't). I then edit the cells in W:AF and concatenate them in AG. The reason I do this is because some cells in E have more than 31 characters so I send them to columns and I want to see exactly which cell makes the total count more than 31 characters. Does that make sense?

  6. #6
    Forum Contributor
    Join Date
    02-13-2013
    Location
    Columbia, SC
    MS-Off Ver
    Excel 2010
    Posts
    217

    Re: Highlighting Conditional Character Count

    And after changing it, nothing gets highlighted. Before only the concatenate cell was, now nothing is. I see why. You are just taking the character count of each cell. I want them to add up. So if cell A contains 7 characters and cell B contains 4 then cell B is highlighted because 7+4 = 11 >10. Does that make sense?

    I am saying 10 and cells A and before for simplicity. Really character count limit is 31 and it starts in cell W:AF
    Last edited by bjcowen9000; 02-18-2013 at 05:03 PM.

  7. #7
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Highlighting Conditional Character Count

    I'll have to look at it again later.

  8. #8
    Forum Contributor
    Join Date
    02-13-2013
    Location
    Columbia, SC
    MS-Off Ver
    Excel 2010
    Posts
    217

    Re: Highlighting Conditional Character Count

    Ok, I do appreciate your help on this. I think the code is close, just have to take into account the characters in each cell before the one you are looking at.
    So basically I want to start counting characters in cell W going to AF. Each time I want to count characters and add one character for a space except last word because you don't need a space after that. If count goes over in cell Z, then Z is highlighted, if AD, then AD is highlighted. Only one cell should be highlighted per row because it should only reach the limit once.
    Last edited by bjcowen9000; 02-18-2013 at 05:13 PM.

  9. #9
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Highlighting Conditional Character Count

    Hi BJ,

    Try this version:

    Please Login or Register  to view this content.
    Last edited by xladept; 02-18-2013 at 11:09 PM.

  10. #10
    Forum Contributor
    Join Date
    02-13-2013
    Location
    Columbia, SC
    MS-Off Ver
    Excel 2010
    Posts
    217

    Re: Highlighting Conditional Character Count

    It is not highlighting the right cell unfortunately. I am also not sure if you are taking spacing into account. After each word it needs to be treating like a space. I also do not need a function to concatenate the cells. I just need a function to count characters in columns W:AF and highlight the cell between the two columns that goes over the 31 character limit. Remember it needs to account for a space after each cell except the last with data in it (don't need a space at end of sentence)

    Thank you for your effort!

  11. #11
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Highlighting Conditional Character Count

    See if it lines up now:

    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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