+ Reply to Thread
Results 1 to 7 of 7

Unable to find visible mark for cells with un-displayed overflow text

  1. #1
    Registered User
    Join Date
    09-20-2018
    Location
    US
    MS-Off Ver
    Professional Plus 2013
    Posts
    7

    Unable to find visible mark for cells with un-displayed overflow text

    I am building a program flow diagram in excel, which has the following structure:

    Item1
    Item2 Column2 Column3
    Item3 spans spans
    Item4 5 rows 5 rays
    Item 5
    I t e m 6 s p a n s a l l 3 c o l u m n s


    I turned on word-wrap and auto-resize for every cell, and it works for column 1. I didn't expect it to work for the merged cells (most of column 2 and 3, and row 6), but I would like to have some indicator that tells me these cells aren't displaying all the text. Is there a way to do that? I feel like older versions of excel had a little icon that would appear in the cell when there was un-displayed overflow text like that.

    Thanks!
    Last edited by jordana309; 09-20-2018 at 03:02 PM. Reason: Table looks aweful

  2. #2
    Registered User
    Join Date
    09-20-2018
    Location
    US
    MS-Off Ver
    Professional Plus 2013
    Posts
    7

    Re: Unable to find visible mark for cells with un-displayed overflow text

    I found a solution, though it didn't work as well as I hoped. I wasn't allowed to post the code, so my comments on it first, and I'll try to wrestle with getting the code up.

    The idea here was to create a function that I could use in conditional formatting. In words, the process goes:
    - Determine the pixel width of the characters in a cell
    - Divide that value by the pixel width of the cell to get an estimate for number of lines
    - I ended up having to manually add line breaks in a separate function, because it isn't counted in length calculation
    - Compare the estimated number of lines to the height of the cell divided by the height of a 1-line reference cell

    So, everything works as expected except InitChrWidths(). The values given here are supposed to be ratios of the font point size to pixel width of the characters. In my testing, I found that these ratios (at least with Calibri, size 11) were horrendously off from what ColumnWidth() gave me, and you can see I tinkered with the values. Basically, I put the characters from each group repeating in a cell that measured 100 px across using ColumnWidth(). I then took
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    to determine the average size of each character in the group. I also put every character from each group in a separate column (one per row) and let excel autosize the column. Taking these two different values, I took different weighted averages until LenInPoints() was extremely close to ColumnWidth(). I also had a cell with all characters for which we assign sizes, and it was pretty close.

    But when I tried to copy this to another sheet, I got exceptionally small values for the LenInPoints(), so I'm not sure what's going on. What I do know is that this is not a reliable way to measure Calibri's size. Another thing I tested was choosing a different font size, and the proportions of growth between the letters were not the same. Even changing the zoom state of my view effected how the letters sat in the cells.

    I also had the idea to use an average value of the size for all characters --
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    , but I realized that this wouldn't help either because of the zoom scaling issue, and ended up being more work that it was worth. Still, the ColumnWidth() and RowHeight() functions are useful and took me a surprisingly long time to find, so I'll leave this partial solution here for future generations.
    Last edited by jordana309; 09-25-2018 at 11:26 AM.

  3. #3
    Registered User
    Join Date
    09-20-2018
    Location
    US
    MS-Off Ver
    Professional Plus 2013
    Posts
    7

    Re: Unable to find visible mark for cells with un-displayed overflow text

    Module 1:
    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    09-20-2018
    Location
    US
    MS-Off Ver
    Professional Plus 2013
    Posts
    7

    Re: Unable to find visible mark for cells with un-displayed overflow text

    Module 2:
    Please Login or Register  to view this content.
    Last edited by jordana309; 09-25-2018 at 11:16 AM. Reason: slowly adding segments of the code until I find why I'm not allowed to post--it was the @ symbol in my comments under Calibri

  5. #5
    Forum Expert
    Join Date
    06-26-2010
    Location
    Austin, TX
    MS-Off Ver
    Excel 2010
    Posts
    1,673

    Re: Unable to find visible mark for cells with un-displayed overflow text

    I found this at https://www.mrexcel.com/forum/excel-...s-heights.html and it helps explain some of the weirdness of these calculations.

    'Excel bases its measurement of column widths on the number of digits (specifically,
    'the number of zeros) in the column, using the Normal style font. (There are some
    'fonts that have digits of different widths, but this is unusual.)
    '
    'For example, using the default font, a column with a width of 10 refers to the column
    'width needed to display 10 non-bold, non-italic, Arial 10-point zeros. On a Macintosh
    'computer, this same column width consists of 10 non-bold, non-italic Geneva 10-point
    'zeros. Excel uses digits to determine column widths so that when you change the font
    'for a style on a worksheet, the columns grow or shrink to display the specified
    'number of digits in the column.
    '
    'Note that this method of determining column widths is not exact when you use other
    'characters, such as spaces, dollar-signs, parentheses, and so on.

  6. #6
    Forum Expert
    Join Date
    06-26-2010
    Location
    Austin, TX
    MS-Off Ver
    Excel 2010
    Posts
    1,673

    Re: Unable to find visible mark for cells with un-displayed overflow text

    I think you can get rid of the ColumnWidth function. MR.MergeArea.Width works regardless of whether the cell is part of a merged group or just an individual cell in my limited testing.

  7. #7
    Registered User
    Join Date
    09-20-2018
    Location
    US
    MS-Off Ver
    Professional Plus 2013
    Posts
    7

    Re: Unable to find visible mark for cells with un-displayed overflow text

    Pauleyb, so maybe it would be better to have the initCharWidths have the ratio of each letter to a 0 so that my measurement is also in terms of 0's?

    I will look into getting rid of ColumnWidth. I mostly had it so that I could call it in the spreadsheet with =ColumnWidth(cell) and check what was going wrong in my math while writing this.

    Thanks!

+ 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. Find most frequently occurring text string in in a VISIBLE range of cells
    By Odlanier in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 12-01-2013, 05:27 PM
  2. [SOLVED] Conditional formatting to mark cells with on text strnig but lacking another text string
    By KArnoldColumbia in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-14-2013, 04:15 PM
  3. [SOLVED] Find certain text in a cell and mark it as...
    By siobeh in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-29-2013, 12:28 PM
  4. Run Time Error '6' Overflow - Macro That Find Text and Copy Range & Replace on Other Sheet
    By asgharhussaini in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-17-2013, 04:34 AM
  5. Find cells displayed as hash marks due to overflow of contents
    By leunst in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 08-15-2012, 08:42 AM
  6. Find text and mark cell
    By Robban_HG in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-07-2009, 01:42 AM
  7. Stop text overflow into next cells?
    By baubert in forum Excel General
    Replies: 1
    Last Post: 05-27-2007, 11:30 PM

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