Underline a number in a label on a userform?

birdieman

Well-known Member
Joined
Jan 13, 2016
Messages
551
1. Is it possible to underline a number through code when writing it to a userform? Example: A calculation yields 2017, and I would like to put it (through code) in a label in a userform with a solid line underneath it, like 2017

2. Is it possible to hard code (like through the properties editor) a line under a number in a userform label?

thanks
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
If you mean underline all the text in a label.

1 Yes

2 Yes
 
Last edited:
Upvote 0
thanks Norie -- I think I will write a letter to Satya Nadella at Microsoft and request they alter Excel to accommodate my needs.
 
Upvote 0
I'm confused and I might have also caused confusion.

When I originally read the post. I thought you wanted to underline just the number in the label text so replied No to both questions.

I reread the post and it appears you want to underline the entire text in the label, and the answer to both questions is Yes for that.
 
Upvote 0
Yes, I want to underline the entire text in the label -- the entire label will always be only one number -- it may be long, but only one number.

so, how do I do that -- both through code and whatever other way there is

thanks
 
Upvote 0
The how to part...

1. Modify the Underline property using VBA
Code:
Label1.Font.Underline = True

2. In the Properties Window with the Label object selected: Click on the Font property > Click on the "..." button > In the Font dialog, check "Underline"
 
Upvote 0
thank you -- I have only looked at the Font property in the properties window about a million times, and totally missed it -- it's right there up front as well !!! thanks to you and Norie
 
Upvote 0

Forum statistics

Threads
1,215,066
Messages
6,122,948
Members
449,095
Latest member
nmaske

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