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,751
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,082,175
Messages
5,363,564
Members
400,750
Latest member
007432

Some videos you may like

This Week's Hot Topics

  • populate from drop list with multiple tables
    Hi All, i have a drop list that displays data, what i want is when i select one of those from the list to populate text from different tables on...
  • Find list of words from sheet2 in sheet1 before a comma and extract text vba
    Hi Friends, Trying to find the solution on my task. But did not find suitable one to the need. Here is my query and sample file with details...
  • Dynamic Formula entry - VBA code sought
    Hello, really hope one of you experts can help with this - i've spent hours on this and getting no-where. .I have a set of data (more rows than...
  • Listbox Header
    Have a named range called "AccidentsHeader" Within my code I have: [CODE]Private Sub CommandButton1_Click() ListBox1.RowSource =...
  • Complex Heat Map using conditional formatting
    Good day excel world. I have a concern. Below link have a list of countries that carries each country unique data. [URL...
  • Conditional formatting
    Hi good morning, hope you can help me please, I have cells P4:P54 and if this cell is equal to 1 then i want row O to say "Fully Utilised" and to...
Top