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>
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
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
 
Upvote 0
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.
 
Upvote 0
<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>
 
Upvote 0

Forum statistics

Threads
1,214,667
Messages
6,120,815
Members
448,990
Latest member
rohitsomani

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