Good Morning all
a few years ago in an old job some one helped me create this piece of code which adds a comment box once someone adds anything to a cell
i'm getting a run time error
can you please help
thank you Jason
error:
Target.Comment.Shape.TextFrame.Characters(1, Len(Application.UserName)).Font.Bold = True
<code>
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
'changes the cells to UPPERCASE
If Intersect(Target, Range("A1:AH100")) Is Nothing Then Exit Sub
Application.EnableEvents = False
Target = UCase(Target)
Application.EnableEvents = True
'Adds a comment box to each cell when somthing is added to the cell
If Target.Cells.Count > 1 Or IsEmpty(Target) Then Exit Sub
If Not Target.Comment Is Nothing Then Target.Comment.Delete
Target.AddComment Text:=Application.UserName & vbNewLine & Date & vbNewLine & Time
Target.Comment.Shape.TextFrame.Characters(1, Len(Application.UserName)).Font.Bold = True
End Sub
</code>
a few years ago in an old job some one helped me create this piece of code which adds a comment box once someone adds anything to a cell
i'm getting a run time error
can you please help
thank you Jason
error:
Target.Comment.Shape.TextFrame.Characters(1, Len(Application.UserName)).Font.Bold = True
<code>
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
'changes the cells to UPPERCASE
If Intersect(Target, Range("A1:AH100")) Is Nothing Then Exit Sub
Application.EnableEvents = False
Target = UCase(Target)
Application.EnableEvents = True
'Adds a comment box to each cell when somthing is added to the cell
If Target.Cells.Count > 1 Or IsEmpty(Target) Then Exit Sub
If Not Target.Comment Is Nothing Then Target.Comment.Delete
Target.AddComment Text:=Application.UserName & vbNewLine & Date & vbNewLine & Time
Target.Comment.Shape.TextFrame.Characters(1, Len(Application.UserName)).Font.Bold = True
End Sub
</code>
Last edited: