+ Reply to Thread
Results 1 to 5 of 5

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

  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:-

    Please Login or Register  to view this content.
    Any help will be greatly appreciated.

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

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,946

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

    Hi, welcome to the forum

    1st, please use code tags when posting code. I have inserted them for you - this time. (see my foot-notes on how to add them)
    2nd, Please upload a sample of your workbook, not a picture of your data. Pictures are pretty much impossible to edit, and no-one wants to re-type your data for you
    Also, not all members can upload picture files (Company firewalls and stuff)

    Your workbook should show a small desensitized example of the data you are working with and a manual mockup of the expected results.

    3rd, if you are already using vlookup(), why not continue to use that to insert the comment, instead of using VBA?
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

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

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

    Sorry Ford, my first post, don't really know what to do. How do I attach a xls file ?

    How do I insert a comment using vlookup() ?

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,946

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

    To attach a file to your post,
    click advanced (next to quick post),
    scroll down until you see "manage file",
    click that and select "add files" (top right corner).
    click "select files" find your file, click "open" click "upload" click 'done" bottom right. click "submit reply"

    Once the upload is completed the file name will appear below the input boxes in this window.
    You can then close the window to return to the new post screen.

    And I just realised that when you said comment, you actually meant to add a comment to a cell, not have the cell return text, sorry. vlookup() wont do that for you

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

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

    Thanx again Ford. Here is the xls file that I hope will make sense of my post.Test Sheet.xlsm

+ Reply to Thread

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