Quantcast
Channel: Active questions tagged excel - Stack Overflow
Viewing all articles
Browse latest Browse all 88054

VBA Change the text color in MsgBox

$
0
0

I want to change the font color from MsgBox

To understand what I want, I chose this exemple:

Dim a As Integer
Dim b As Integer
Dim c As Integer
Dim results As String


a = InputBox("Enter your first value:")
b = InputBox("Enter your second value:")
c = InputBox("Enter your third value:")

d = a - b + c

If d = 0 Then
    results = "Correct"
    MsgBox "Your results is: "& results 
Else
    results = "Incorrect"
    MsgBox " Your Results is: "& results 
End If

The "Correct" text I want to be in green when it appears in MsgBox; the "Incorrect" text I want to be in red when it appears in MsgBox

I hope what I have requested is possible.


Viewing all articles
Browse latest Browse all 88054

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>