Chris Macro
Well-known Member
- Joined
- Nov 2, 2011
- Messages
- 1,345
- Office Version
- 365
- Platform
- Windows
I have a string "Comments: " inside a comment textbox and I want to have just "Comments" bolded out in the string and everything else to be normal font. So the end result would look like "Comments: These are my comments". My problem is that through the following two macros that my textbox is bolding the entire string of words instead of the specific one I want. Any ideas on how to fix this?
Userform 1:
<font face=Calibri><SPAN style="color:#007F00">'Comments</SPAN><br> ActiveSheet.Shapes("Textbox 2").TextFrame.Characters.Text = "Comments: " & Comments<br> <SPAN style="color:#007F00">'Bold "Comments:"</SPAN><br> ActiveSheet.Shapes("Textbox 2").OLEFormat.Object.Characters(1, 8).Font.FontStyle = "Bold"</FONT>
Macro 1:
<font face=Calibri><SPAN style="color:#00007F">Sub</SPAN> Clear_Sheet()<br><br><SPAN style="color:#00007F">With</SPAN> Sheet1<br><br> <SPAN style="color:#007F00">'Clear Comment Box</SPAN><br> .Shapes("Textbox 2").TextFrame.Characters.Text = "Comments: "<br> <SPAN style="color:#007F00">'Bold "Comments:"</SPAN><br> .Shapes("Textbox 2").OLEFormat.Object.Font.FontStyle = "Normal"<br> .Shapes("Textbox 2").OLEFormat.Object.Characters(1, 8).Font.FontStyle = "Bold"<br> <br> <SPAN style="color:#007F00">'Clear Data</SPAN><br> .Range("B12:I2000").ClearContents<br> <br> <SPAN style="color:#007F00">'Clear Header Data</SPAN><br> .Range("C2:C5").ClearContents<br><br><SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">With</SPAN><br><br><SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">Sub</SPAN><br></FONT>
Userform 1:
<font face=Calibri><SPAN style="color:#007F00">'Comments</SPAN><br> ActiveSheet.Shapes("Textbox 2").TextFrame.Characters.Text = "Comments: " & Comments<br> <SPAN style="color:#007F00">'Bold "Comments:"</SPAN><br> ActiveSheet.Shapes("Textbox 2").OLEFormat.Object.Characters(1, 8).Font.FontStyle = "Bold"</FONT>
Macro 1:
<font face=Calibri><SPAN style="color:#00007F">Sub</SPAN> Clear_Sheet()<br><br><SPAN style="color:#00007F">With</SPAN> Sheet1<br><br> <SPAN style="color:#007F00">'Clear Comment Box</SPAN><br> .Shapes("Textbox 2").TextFrame.Characters.Text = "Comments: "<br> <SPAN style="color:#007F00">'Bold "Comments:"</SPAN><br> .Shapes("Textbox 2").OLEFormat.Object.Font.FontStyle = "Normal"<br> .Shapes("Textbox 2").OLEFormat.Object.Characters(1, 8).Font.FontStyle = "Bold"<br> <br> <SPAN style="color:#007F00">'Clear Data</SPAN><br> .Range("B12:I2000").ClearContents<br> <br> <SPAN style="color:#007F00">'Clear Header Data</SPAN><br> .Range("C2:C5").ClearContents<br><br><SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">With</SPAN><br><br><SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">Sub</SPAN><br></FONT>