ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Insert Comment (https://www.excelbanter.com/excel-programming/421026-insert-comment.html)

Larry S

Insert Comment
 

I want to insert a comment in an active cell that shows the username and the
word "ordered". I want the comment to be on two lines as shown:

username
ORDERED

Thanks,
Larry


RadarEye

Insert Comment
 
Hi Larry,

I created this in XL2003:

Sub AddComment()
On Local Error Resume Next

ActiveCell.AddComment
ActiveCell.Comment.Text _
Text:=Application.UserName & _
vbNewLine & "ORDERED"
End Sub

HTH,

Wouter

Gary''s Student

Insert Comment
 

Sub Macro1()
With ActiveCell
.AddComment
.Comment.Visible = False
.Comment.Text Text:=Application.UserName & Chr(10) & "ORDERED"
End With
End Sub

--
Gary''s Student - gsnu200819

Larry S

Insert Comment
 

Thanks Gary. Works perfectly.

"Gary''s Student" wrote:

Sub Macro1()
With ActiveCell
.AddComment
.Comment.Visible = False
.Comment.Text Text:=Application.UserName & Chr(10) & "ORDERED"
End With
End Sub

--
Gary''s Student - gsnu200819



All times are GMT +1. The time now is 02:42 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com