Results 1 to 5 of 5

Automatically insert and\or change comments based on vlookup of cell value

Threaded View

  1. #1
    Registered User
    Join Date
    09-10-2014
    Location
    Unanderra, Austalia
    MS-Off Ver
    2010
    Posts
    3

    Automatically insert and\or change comments based on vlookup of cell value

    Hi Everyone,

    I am after a code that will insert a comment into a cell based on a vlookup of the cell value.

    I have three columns (B, I and P) with formulas using data from other columns (C:H, J:O and Q:V respectively) in the same sheet. I want a comment automatically inserted in each cell in columms B, I and P based on a vlookup of the cell value using defined name ranges. Eg, looking at the attached pdf Test Sheet.pdf, B4 comment would be "Rank 4 Description" by using vlookup(B4,"Tier_One",2,0), I4 comment would be "Rank 2 Description" by using vlookup(I2,"Tier-Two",2,0), etc.

    The data used for the formulas will change often, therefore, the comments will also need to be updated as and when the cell value changes.

    I have been trying to modify the below code (I didn't write this code) to suit but have no real idea of what I am doing:-

    Private Sub Worksheet_Change(ByVal Target As Range)
        If Target.Address = ("B4") Then
            s = Application.VLookup(Range("B4:B200"), Range("Tier_One"), 2, 0)
            With Range("B4", Range("B200").End(xlUp))
                .ClearComments
                .AddComment
                .Comment.Visible = False
                .Comment.Text Text:=s
            End With
        End If
    End Sub
    Any help will be greatly appreciated.

    Thanx
    Last edited by FDibbins; 09-11-2014 at 09:51 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Automatically insert value based on another, and change date if weekend
    By acohen12 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-17-2013, 11:52 AM
  2. automatically change cell value based on the value in other sheet.
    By star.dust9212 in forum Excel - New Users/Basics
    Replies: 4
    Last Post: 11-15-2011, 06:21 AM
  3. Automatically change text in cell based upon a rule
    By Beanymonster in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-16-2009, 09:28 AM
  4. Having Cell Color Change Automatically Based on Value
    By jamesfedwards in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 12-21-2006, 10:47 AM
  5. Automatically insert a date value based on the value from another cell
    By cmartin2459 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 07-19-2006, 02:18 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1