I have a requirement to put a hyphen ("-") at the end of line. for eg if a word in cell comes to a second line after word wrap then it should have hyphen at the end like
Are you able to work out how many characters you can fit on a line in the wrapped cell including the “-” or is changing?
I would expect that Capitals will complicate this but, if you’re working with a variable that has limited number of total characters you could try breaking it up into sections & inserting “-” between sections.
For instance (and I’ve not got the time to do this in formula at the mo)
say you’ve got 7 characters possible on a line.
if the 7th and 8th characters of the variable string are characters (use isstring() to find out), then left([string];6)+"-"+substr([string];7;7)
That’s quite a closed statement and would cope if the string of text you’ve got is only ever less than or equal to 14 chars long…
If your string is longer than that, then you would have to nest various tests on your string to determine if and when a “-” is necessary.
To be honest, I do kind of doubt this would work as you might hope because (potentially) of either Capital Letters or letters like “i” which are thinner than “e” - for example. There’s no way I can think of to just automatically format a cell to pop a hyphon at the end of a row in a cell… which is a shame because that’d be the prefered solution.
You may have to turn round and say it’s not possible if noone else can help.
An alternative is to shove a column to the right of the column in question and populate it with a single hyphen left justified. Hide the borders beween the columns and off you go. You’d need to right justify the first column which may look strange, so not ideal but saves coming up with a really nasty formula.
They obviously have a mega fussy manager! Nick, I like your solution, but at the end of the day you’d still have to tackle the subject of when and where you’d need a hyphen in the string of text. To be honest I’d tell someone requesting this that it’s just not possible and move on to something that really matters!
The exception will be when you have something that is simply too long (eg ThisIsMyColumnNameThatHasNoSpacesToWrapOn). That will wrap in a weird spot.
Chances are this problem could be solved for most cases by increasing the column width - and then as Dave says the word wrap feature will not split too many words.
–> My values in the column are of variable lengths so i can not put statis lengths in substrings.
–> Report’s format is so tightly coupled such that if you add a single column the table goes to the second page, i have to fit whole thing into a single page.