Chris Macro
Well-known Member
- Joined
- Nov 2, 2011
- Messages
- 1,345
- Office Version
- 365
- Platform
- Windows
I have a textbox that will say various things depending upon how the macro is run. I am stuck on the "Else" part of my if/then statement where I want the outcome to read as follows:
Revenue:
(Increase)/Decrease
Expenses:
Increase/(Decrease)
Instead my macro is ouputing the following:
Revenue:
(Increase)/Decrease
Expenses:
Increase/(Decrease)
I can't figure out why the end of my text is getting bolded. Any thoughts?
Code:
<font face=Calibri> <SPAN style="color:#007F00">'Update Increase/Decrease Textbox ("IncreaseDecreaseBox" is the name of the textbox)</SPAN><br> ActiveSheet.Shapes("IncreaseDecreaseBox").OLEFormat.Object.Characters.Font.Bold = <SPAN style="color:#00007F">False</SPAN><br> <br> <SPAN style="color:#00007F">If</SPAN> SelectedStmt = "Assets" <SPAN style="color:#00007F">Then</SPAN><br> ActiveSheet.Shapes("IncreaseDecreaseBox").TextFrame.Characters.Text = "Assets:" & vbNewLine & "Increase/(Decrease)"<br> ActiveSheet.Shapes("IncreaseDecreaseBox").OLEFormat.Object.Characters(1, 7).Font.FontStyle = "Bold"<br> <br> <SPAN style="color:#00007F">ElseIf</SPAN> SelectedStmt = "Liabilities" <SPAN style="color:#00007F">Then</SPAN><br> ActiveSheet.Shapes("IncreaseDecreaseBox").TextFrame.Characters.Text = "Liabilities:" & vbNewLine & "(Increase)/Decrease"<br> ActiveSheet.Shapes("IncreaseDecreaseBox").OLEFormat.Object.Characters(1, 12).Font.FontStyle = "Bold"<br> <SPAN style="color:#00007F">Else</SPAN><br> ActiveSheet.Shapes("IncreaseDecreaseBox").TextFrame.Characters.Text = "Revenue:" & vbNewLine & "(Increase)/Decrease" & vbNewLine & vbNewLine & "Expenses:" & vbNewLine & "Increase/(Decrease)"<br> ActiveSheet.Shapes("IncreaseDecreaseBox").OLEFormat.Object.Characters(1, 8).Font.FontStyle = "Bold"<br> ActiveSheet.Shapes("IncreaseDecreaseBox").OLEFormat.Object.Characters(29, 38).Font.FontStyle = "Bold"<br> <br> <SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">If</SPAN></FONT>
Revenue:
(Increase)/Decrease
Expenses:
Increase/(Decrease)
Instead my macro is ouputing the following:
Revenue:
(Increase)/Decrease
Expenses:
Increase/(Decrease)
I can't figure out why the end of my text is getting bolded. Any thoughts?
Code:
<font face=Calibri> <SPAN style="color:#007F00">'Update Increase/Decrease Textbox ("IncreaseDecreaseBox" is the name of the textbox)</SPAN><br> ActiveSheet.Shapes("IncreaseDecreaseBox").OLEFormat.Object.Characters.Font.Bold = <SPAN style="color:#00007F">False</SPAN><br> <br> <SPAN style="color:#00007F">If</SPAN> SelectedStmt = "Assets" <SPAN style="color:#00007F">Then</SPAN><br> ActiveSheet.Shapes("IncreaseDecreaseBox").TextFrame.Characters.Text = "Assets:" & vbNewLine & "Increase/(Decrease)"<br> ActiveSheet.Shapes("IncreaseDecreaseBox").OLEFormat.Object.Characters(1, 7).Font.FontStyle = "Bold"<br> <br> <SPAN style="color:#00007F">ElseIf</SPAN> SelectedStmt = "Liabilities" <SPAN style="color:#00007F">Then</SPAN><br> ActiveSheet.Shapes("IncreaseDecreaseBox").TextFrame.Characters.Text = "Liabilities:" & vbNewLine & "(Increase)/Decrease"<br> ActiveSheet.Shapes("IncreaseDecreaseBox").OLEFormat.Object.Characters(1, 12).Font.FontStyle = "Bold"<br> <SPAN style="color:#00007F">Else</SPAN><br> ActiveSheet.Shapes("IncreaseDecreaseBox").TextFrame.Characters.Text = "Revenue:" & vbNewLine & "(Increase)/Decrease" & vbNewLine & vbNewLine & "Expenses:" & vbNewLine & "Increase/(Decrease)"<br> ActiveSheet.Shapes("IncreaseDecreaseBox").OLEFormat.Object.Characters(1, 8).Font.FontStyle = "Bold"<br> ActiveSheet.Shapes("IncreaseDecreaseBox").OLEFormat.Object.Characters(29, 38).Font.FontStyle = "Bold"<br> <br> <SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">If</SPAN></FONT>