auntie bella
Board Regular
- Joined
- Apr 3, 2009
- Messages
- 50
I am getting a Run time error 91 on the code below - (Object variable or With Block variable not set).
Unfortunately as a novice at VBA I haven't a clue what this is about .
However the code does do what I want it to.
Can someone explain for me?
==========================================
Sub CommentAddOrEdit()
Dim rFind As Range
For Each c In Range("C1:D12")
If Not c.Comment Is Nothing Then c.Comment.Delete
Set rFind = Worksheets("Sheet2").Rows(1).Find(What:=c.Value, LookAt:=xlWhole)
If Not rFind.Comment Is Nothing Then
c.AddComment.Text rFind.Comment.Text
End If
Next c
End Sub
Unfortunately as a novice at VBA I haven't a clue what this is about .
However the code does do what I want it to.
Can someone explain for me?
==========================================
Sub CommentAddOrEdit()
Dim rFind As Range
For Each c In Range("C1:D12")
If Not c.Comment Is Nothing Then c.Comment.Delete
Set rFind = Worksheets("Sheet2").Rows(1).Find(What:=c.Value, LookAt:=xlWhole)
If Not rFind.Comment Is Nothing Then
c.AddComment.Text rFind.Comment.Text
End If
Next c
End Sub