Good day all.
I found this template somewhere on the net.
Is it possible to copy the comment and image?
Good day all.
I found this template somewhere on the net.
Is it possible to copy the comment and image?
I don't think an UDF can return image as comment.
Instead of UDF, I would suggest using worksheet_Change event to trigger change from column E, then copy (value + comment) matching cell in to column F
Put below code in worksheet module (Right-click tab name, "view code")
PHP Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim xReturn As Variant
Dim ycell As Range, rng As Range
If Intersect(Target, Range("E5:E" & Cells(Rows.Count, "E").End(xlUp).Row)) Is Nothing Then Exit Sub
Set rng = Range("B5:C" & Cells(Rows.Count, "B").End(xlUp).Row)
xReturn = Application.Match(Target, rng.Columns(1), 0)
If IsError(xReturn) Then
With Target.Offset(, 1)
.Comment.Delete
.Value = "Not Found"
End With
Else
Set ycell = rng.Columns(2).Cells(1)(xReturn)
ycell.Copy Destination:=Target.Offset(, 1)
End If
End Sub
Quang PT
I am getting this error when I tried to delete value in E, why is that?
Please Login or Register to view this content.
Say for instance I want to change the set rng from another sheet (L2), how do I do that?
Last edited by basicexcel010; 07-26-2022 at 08:47 PM.
Anyone can help me out please?
Good day all.
I am still getting error whenever I tried to delete values in E, why is that?
If I want to change the set rng from another sheet (L2), how do I do that?Please Login or Register to view this content.
Maybe start from the beginning. Explain to us step by step WHAT you want to achieve. And we may tell you HOW to achieve it.
The lack of a satisfactory answer so far may be because we don't understand your problem.
Artik
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks