• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Change color and font baseed on Input provided

Hi All,

It is possible to change color and font automatically once we give our text in msg box.



Private Sub CommandButton1_Click()
Dim msg As String
usermsg = InputBox("Pleas Type your Name", "message entry form", "enter your message here", 100, 200)
Range("h5").Value = usermsg
Range("h5").Font.Size = 15
End Sub

Thanks
Jawahar Prem
 
Hi All,

It is possible to change color and font automatically once we give our text in msg box.



Private Sub CommandButton1_Click()
Dim msg As String
usermsg = InputBox("Pleas Type your Name", "message entry form", "enter your message here", 100, 200)
Range("h5").Value = usermsg
Range("h5").Font.Size = 15
End Sub

Thanks
Jawahar Prem
Hi,

What do you mean?
Do you wish to have that text in "H5" with font size 15 and a different color?

If so, try the following (it will set the text color to red):
Code:
Private Sub CommandButton1_Click()

    Dim msg As String
    usermsg = InputBox("Pleas Type your Name", "message entry form", "enter your message here", 100, 200)
    With Range("h5")
        .Value = usermsg
        .Font.Size = 15
        .Font.Color = vbRed
    End With
  
End Sub

Not sure this is what you wanted but I hope this helps.
 
Hi Costa thanks for your time,
my request is the mentioned text has to change multiple color & font automaticall, it is possible.

thanks.
 
It hard for me to understand the questions in Chandoo, does this help you?
Hi bellke,
Thanks your time, this is really super. and my requirment if i enter name in msg box it will show in mentioned cell and need to change color and font automatically. it is possible thanks.

Regards
Jawahar Prem
 
Hi,

Please help on this too..

multiple color to be changed while input of name...

Private Sub CommandButton1_Click()

Dim msg As String
usermsg = InputBox("Pleas Type your Name", "message entry form", "enter your message here", 100, 200)
With Range("h5")
.Value = usermsg
.Font.Size = 15
.Font.Color = vbRed
End With

End Sub
 
Back
Top