Unable To Return To Normal Texct From Italic

Ark68

Well-known Member
Joined
Apr 5, 2005
Messages
3,199
I was successfull in italicizing text in my textbox, but I am struggling with turning the italic format off to return the text to normal.

Code:
                With uf9_poststaff
                    .pin.Enabled = True
                    .dcard_id.Enabled = True
                    .dcard_no.Enabled = True
                    .dcard_id.Font.Italic = False
                    .dcard_id.ForeColor = RGB(0, 0, 0)
                    .dcard_no.Font.Italic = False
                    .dcard_no.ForeColor = RGB(0, 0, 0)
                    .pin.Font.Italic = False
                    .pin.Font.ForeColor = RGB(0, 0, 0)
                    mbevents = True
                
                    .vm_emplschedule.Enabled = True
                    .v_employeepp.Enabled = True
                End With
Is anyone able to reveal what I'm doing wrong?
 

DanteAmor

Well-known Member
Joined
Dec 3, 2018
Messages
7,919
Office Version
2007
Platform
Windows
This instruction does not change to normal?
Code:
[COLOR=#0000ff].dcard_id.Font.Italic = False[/COLOR]
Does it send you an error?
 

Ark68

Well-known Member
Joined
Apr 5, 2005
Messages
3,199
Hi Dante,

No, it doesn't for some reason, which is why I posted. No errors thown either. It seems pretty simple which is why I am at odds as to why it isn't working. All other properties I change for these textboxes get applied, just not the italic.
 

James006

Well-known Member
Joined
Apr 4, 2009
Messages
3,669
Hello,

Just create a test file, a simple userform with a TextBox ...

And test again your exact code ...

It will allow to determine if your Excel version has a problem ... or not ...

Hope this will help
 

DanteAmor

Well-known Member
Joined
Dec 3, 2018
Messages
7,919
Office Version
2007
Platform
Windows
And if you play a little with the letter styles.
eg.


Code:
        'italic on
        Me.dcard_id.Font.Name = "Monotype Corsiva"
        '
        'italic off
        Me.dcard_id.Font.Name = "Tahoma"
 

Ark68

Well-known Member
Joined
Apr 5, 2005
Messages
3,199
Just create a test file, a simple userform with a TextBox ...
The problem was not recreated in the test file. I was able to toggle between italic and non italic in the textbox without issue.

And if you play a little with the letter styles.
In my code, after the set the .font.italic = false, I added the line .font.name = "Monotype Corsiva".
The textbox remained in italics, but the font changed.
 

DanteAmor

Well-known Member
Joined
Dec 3, 2018
Messages
7,919
Office Version
2007
Platform
Windows
The problem is the font style

This does not work

Turn on:
Code:
        Me.dcard_id.Font.Name = "Monotype Corsiva"
        Me.dcard_id.Font.Italic = True
Turn off:
Code:
        Me.dcard_id.Font.Name = "Monotype Corsiva"
        Me.dcard_id.Font.Italic = False
[HR][/HR]This works:
Turn on:
Code:
        Me.dcard_id.Font.Name = "Tahoma"
        Me.dcard_id.Font.Italic = True
Turn off:
Code:
        Me.dcard_id.Font.Name = "Tahoma"
        Me.dcard_id.Font.Italic = False
[HR][/HR]Then use another font style
 

Forum statistics

Threads
1,078,437
Messages
5,340,282
Members
399,363
Latest member
farhan11941234

Some videos you may like

This Week's Hot Topics

  • Problem with Radio Button's format control
    I am creating an employee evaluation template (a sample is below) Column A is the category Column B, C D, E and F will be ratings (unacceptable...
  • Last Display on userform to a Listbox
    [CODE=vba] lstdisplay.ColumnCount = 15 lstdisplay.RowSource = "A1:O600000" [/CODE] So when i do this it Displays everything on the sheet i am...
  • Rename and move files to a new location
    Dear all, I have an excel file with the following information. The actual file name is at column A but i want to rename it using the following...
  • Help with True/False Formula
    Hello! Am stumped how to fix this formula, in which my result returns 'True', but it should return False. =IF(AG2=True...
  • Clear extra characters from a provided range of cells
    Dear All, I have following code which gives me desired output to remove extra characters from a provided range. But it takes too much time when...
  • Help with Current and highest streaks
    Hi there, I've just joined the forum and this is my first post. I've already spent quite a bit of time searching the net and this forum for a...
Top