Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Trying to prevent error in the statement
If myAE = "Add" Then and there is already a comment in the cell and the user tries to Add another comment. Thanks, Howard Sub myAdd_myEdit_myDelete_Comment() Dim myAdd, myEdit, myAE Dim MyComment As String Dim commentCell As Range Dim cmt As Comment myAE = InputBox("If adding comment enter ""Add""" _ & vbCr & vbCr & _ "If editing comment enter ""Edit""" _ & vbCr & vbCr & _ "If Deleting comment enter ""Delete""", "Comments") If myAE = "Add" Then ActiveSheet.Unprotect Password:=123 Set commentCell = ActiveCell MyComment = InputBox("Enter your comments", "Comments") Range(commentCell.Address).AddComment Range(commentCell.Address).Comment.Text Text:=MyComment ElseIf myAE = "Edit" Then MyComment = InputBox("Enter your comments", "Comments") ActiveCell.Comment.Text Text:=MyComment ElseIf myAE = "Delete" Then ActiveCell.Comment.Delete ActiveSheet.Protect Password:=123 End If End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
ActiveCell.Offset(i, 0) = Chr(ActiveCell.Row + 62) returns all A's | Excel Programming | |||
Amend sub to re-hide comment when activecell change to another | Excel Programming | |||
Exit Field vs Exit Button...... | Excel Programming | |||
If activecell.column = variable then activecell,offset (0,1) | Excel Discussion (Misc queries) | |||
If a called sub exit, how to the caller exit right away? | Excel Programming |