Underlining a Value in a Variable
Closed
AdiK
-
23 Nov 2016 à 05:32
yg_be Posts 23437 Registration date Sunday 8 June 2008 Status Contributor Last seen 6 June 2025 - 24 Nov 2016 à 16:12
yg_be Posts 23437 Registration date Sunday 8 June 2008 Status Contributor Last seen 6 June 2025 - 24 Nov 2016 à 16:12
Related:
- Underlining a Value in a Variable
- How to get rid of underline in css - Guide
- My documents environment variable - Guide
- How to underline a letter on iphone - Guide
- Find and replace underlined words for a blank. - PowerPoint Forum
- Creation d'une table de nom variable dans mysql avec php - Programming Forum
2 responses
TrowaD
Posts
2921
Registration date
Sunday 12 September 2010
Status
Contributor
Last seen
27 December 2022
555
24 Nov 2016 à 11:36
24 Nov 2016 à 11:36
Hi AdiK,
You can't apply format to a variable, but you can to a cell.
Best regards,
Trowa
You can't apply format to a variable, but you can to a cell.
Sub underline()
Dim x As Variant
x = "Hello"
Range("A1") = x
Range("A1").Font.underline = True
End Sub
Best regards,
Trowa
yg_be
Posts
23437
Registration date
Sunday 8 June 2008
Status
Contributor
Last seen
6 June 2025
5
24 Nov 2016 à 16:12
24 Nov 2016 à 16:12
I would rather try something such as :
A good method to learn about that is to record a macro while manually changing the format of a cell : you will see in the recorded VBA code how to programmatically access those attributes.
Range("A3").Font.Underline = xlUnderlineStyleSingle
A good method to learn about that is to record a macro while manually changing the format of a cell : you will see in the recorded VBA code how to programmatically access those attributes.