Hi Forum,
trying to add an add comment form to my workbook. cant seem to get it to work fully. first two comboboxes work to select the cell to add comment which has data already entered to it. just when the add comment button is pressed comes up run time error 5 ?? Think im missing something so thought i would ask the forum ?? code below.
line that seems to be the problem is this one With .AddComment(Me.TBComment1.Text).
cheers Mark
Private Sub cmdaddcomment_Click()
ActiveSheet.Unprotect Password:="1"
If ComboBox3.Value = "" Or ComboBox4.Value = "" Then
'display a message
Exit Sub
End If
Dim a
With Sheets("Mark Equipment Stock")
With .Columns(.Rows(2).Find(ComboBox3.Value, lookat:=xlWhole).Column).Find(ComboBox4.Value, lookat:=xlWhole)
.Value = ""
If .Offset(1).Value <> "" Then
With .Parent.Range(.Offset(1), .Parent.Cells(.Parent.Rows.Count, .Column).End(xlUp))
a = .Value
.Value = ""
.Offset(-1).Value = a
With .AddComment(Me.TBComment1.Text)
.Visible = False
End With
End With
End If
End With
End With
'display a message
ActiveSheet.Protect Password:="1"
End Sub
Bookmarks