Transparent text in a shapes("TextBox 1")

repairman615

Well-known Member
Joined
Dec 21, 2009
Messages
1,885
Hello,

I have a textbox placed in the sheet from the insert menu.

It is possible to set the transparency of the text manually...right click>format text effect>fill>transparency.

Using vba, how could this be accomplished?
Any insight is greatly appreciated.

<font face=Courier New>        <SPAN style="color:#00007F">With</SPAN> wSht1.Shapes("TextBox " & HroW)<br>            .TextFrame.Characters.Text = Ans<br>            .Fill.ForeColor.RGB = RGB(170, 170, 170)<br>            .TextFrame.Characters.Font.Color = RGB(200, 200, 200)<br>            <br>            <SPAN style="color:#007F00">'.TextEffect.Transparency = 0.1     ''''How To Set Transparency of Text??</SPAN><br>            <br>            .Top = Rowh * HroW - Rowh<br>            .Left = 0 <SPAN style="color:#007F00">'Colw * (144 / 192)</SPAN><br>            .Height = Rowh<br>            .Width = Colw * (144 / 192) * 14<br>            .Fill.Transparency = 0.9<br>        <SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">With</SPAN></FONT>
 

pgc01

MrExcel MVP
Joined
Apr 25, 2006
Messages
19,755
Hi

Try:

Code:
        With wSht1.Shapes("TextBox " & HroW)
            
            .Top = Rowh * HroW - Rowh
            .Left = 0
            .Height = Rowh
            .Width = Colw * (144 / 192) * 14
            
            With .TextFrame2.TextRange.Characters
                .Text = Ans
                With .Font.Fill
                    .ForeColor.RGB = RGB(200, 200, 200)
                    .Transparency = 0.5
                End With
            End With
            
            With .Fill
                .ForeColor.RGB = RGB(170, 170, 170)
                .Transparency = 0.9
            End With
            
        End With
 

repairman615

Well-known Member
Joined
Dec 21, 2009
Messages
1,885
pgc01,
That works great, thank you for the code changes you provided.

It seems this topic is not well documented per results from multiple searches. I hope that if one ever needs to control the text transparency, they will find your helpful post.

Again, Thank You.
 

ashleedawg

New Member
Joined
Oct 12, 2017
Messages
11
<code>
Code:
With ActiveWindow.Selection.ShapeRange(1)
    With .TextFrame2.TextRange.Font.Fill
        .Transparency = 0.5
    End With
End With
Full answer at the source.
</code>
 

Forum statistics

Threads
1,085,036
Messages
5,381,317
Members
401,733
Latest member
Kabasa007

Some videos you may like

This Week's Hot Topics

Top