Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Intersect(Target, Range("A1:A10")) Is Nothing Then Exit Sub
UserForm1.Show
End Sub
I don't think that you can change the font size of the message if you use Data Validation. You would have to create a userform with a textbox and set the font size using the Font Property of the textbox. Then in the worksheet code module, you would need a macro such as this:
which will show the userform when you click on any cell in the target range. Is it worth doing all this just for a font change?Code:Private Sub Worksheet_SelectionChange(ByVal Target As Range) If Intersect(Target, Range("A1:A10")) Is Nothing Then Exit Sub UserForm1.Show End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Column = 1 And Target.Row = 1 Then
Dim cmt As Comment
Set cmt = Target.Comment
If cmt Is Nothing Then
Target.AddComment "Hello"
Target.Comment.Shape.TextFrame.Characters.Font.Size = 15
Else
Target.Comment.Delete
Target.AddComment "Hello"
Target.Comment.Shape.TextFrame.Characters.Font.Size = 15
End If
End If
End Sub