Underlining bottom word in Wrapped cell

Jeffrey Mahoney

Well-known Member
Joined
May 31, 2015
Messages
2,787
Office Version
  1. 365
Platform
  1. Windows
I'm making headers for an income statement report. The headers change depending on the type of report it is. When a cell is wrapped and the words are in multiple rows I have a problem getting only the words on the bottom to underline. I can use this code, but the user has the ability to change the text in the cell and so it messes up the underline.

Code:
IncHdr.Offset(0, 3).Characters(Start:=8, Length:=9).Font.Underline = xlUnderlineStyleSingle

Is there a way to detect which words are on the bottom of the multiple lines? I'm thinking not. Only other way I can think of making it right is to have multiple rows for the words.

Better or Worse Than Budget

<tbody>
</tbody>
 
Thank you Rick ,
Yes , definitely .. This trick is not pretty at all .. I had already tried changing the TextBox Margins but it didn't help much
As you said, the difference between the cells and TextBox character widths + the inconsistent space between characters in the textbox + Margins .. all of that is what causes the problem

The only thing I can think of is using the API, creating a hidden standard Edit Control which has many Properties that can be set and working on the text there .. but it seems overkill
 
Upvote 0

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
I did a quick test. It seemed to be working for a few iterations. Until...

This is text that needs to underlined only at the bottom

<tbody>
</tbody>
 
Upvote 0
I did a quick test. It seemed to be working for a few iterations. Until...

This is text that needs to underlined only at the bottom

<tbody>
</tbody>
In order to see what you see, we would need to know the font name, font size, and width (both numbers) of Column A and maybe the height of Row 1. Also, what is your monitor's screen resolution?
 
Upvote 0

Forum statistics

Threads
1,214,935
Messages
6,122,337
Members
449,077
Latest member
Jocksteriom

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top