• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 97
  • Last Modified:

Populating comment in Excel with results from VBlookup

Experts,

Attached is a sample spreadsheet that I am trying to populate the comment with the results from a vlookup.  Can someone assist me.  

The question was answered in Question 28515631 but I cannot follow what is being done.  Can someone apply to attached spreadsheet that would really help.
0
morinia
Asked:
morinia
  • 2
  • 2
1 Solution
 
MontoyaProcess Improvement MgrCommented:
spreadsheet is missing : )
0
 
moriniaAdvanced Analytics AnalystAuthor Commented:
Sorry,

I atached and forgot to upload.  Here is the file.  It is xlsx.
vlookup.xlsx
0
 
MontoyaProcess Improvement MgrCommented:
0
 
moriniaAdvanced Analytics AnalystAuthor Commented:
I can get the first example to work.

Sub MakeComment()
    With Worksheets(1).Range("A2").AddComment
        .Visible = True
        .Text [F2].Value
    End With
End Sub



I am having a problem with this one which would loop.  i would like to populate comments in  A2 to  A7 with the values in F2 to F7.  How would I code below to do that.


   Sub ValueToComment()
    Dim rCell As Range
    For Each rCell In Selection
        With rCell
            If .HasFormula Then
                On Error Resume Next
                .Comment.Delete
                On Error GoTo 0
                .AddComment
                .Comment.Text Text:=CStr(rCell.Value)
            End If
        End With
    Next
    Set rCell = Nothing
End Sub
0

Featured Post

[Webinar On Demand] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now