Solved

Populating comment in Excel with results from VBlookup

Posted on 2014-09-24
4
90 Views
Last Modified: 2014-09-24
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
Comment
Question by:morinia
  • 2
  • 2
4 Comments
 
LVL 19

Expert Comment

by:Montoya
ID: 40342587
spreadsheet is missing : )
0
 

Author Comment

by:morinia
ID: 40342601
Sorry,

I atached and forgot to upload.  Here is the file.  It is xlsx.
vlookup.xlsx
0
 
LVL 19

Accepted Solution

by:
Montoya earned 500 total points
ID: 40342616
0
 

Author Comment

by:morinia
ID: 40342857
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

A little background as to how I came to I design this code: Around 5 years ago I designed an add-in that formatted Excel files to a corporate standard, applying different cell colours and font type depending on whether the cells contained inputs,…
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question