+ Reply to Thread
Results 1 to 17 of 17

Comments, can they be programmed?

  1. #1
    Registered User
    Join Date
    04-15-2009
    Location
    morristown, ny
    MS-Off Ver
    Excel 2007
    Posts
    39

    Thumbs up Comments, can they be programmed?

    I am looking for a way when you pass the cursor over a cell it Clouds what the cell contents reflect with out having to go other places.

    Example:

    C2 = 12 12 represent a code for "not produced"

    there are other information around that cell so I can not just place a formula next to that cell to show what the code would represent.

    Any help is greatly appreciated.
    Last edited by ed ayers315; 10-31-2009 at 09:10 AM. Reason: Solved

  2. #2
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: Comments, can they be programmed?

    I'm not exactly sure what you want.
    The attached workbook has a VLookup table of Codes and Meanings in A1:B4.

    If you enter a Code in cell of column E, this Worksheet_Change event will add a comment to that cell containing the meaning of the Code entered.
    Please Login or Register  to view this content.
    Attached Files Attached Files
    _
    ...How to Cross-post politely...
    ..Wrap code by selecting the code and clicking the # or read this. Thank you.

  3. #3
    Registered User
    Join Date
    04-15-2009
    Location
    morristown, ny
    MS-Off Ver
    Excel 2007
    Posts
    39

    Re: Comments, can they be programmed?

    Mike,

    Fantastic, works like a charm. I only wish I could put the code language in my head; some I can figure out but so far I have not found literature on what the code really stands for.

    Your great and thanks!!

  4. #4
    Registered User
    Join Date
    04-15-2009
    Location
    morristown, ny
    MS-Off Ver
    Excel 2007
    Posts
    39

    Re: Comments, can they be programmed?

    Hi Mike,

    I can not figure out how to expand the code to include more code and meaning ranges. I up the range from a1:b14 and typed in new codes and meaning in those ranges but the comments stop updating past the "3" code.

  5. #5
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Comments, can they be programmed?

    Try changing this line:
    Please Login or Register  to view this content.
    to this:
    Please Login or Register  to view this content.
    and see if that helps.
    Remember what the dormouse said
    Feed your head

  6. #6
    Registered User
    Join Date
    04-15-2009
    Location
    morristown, ny
    MS-Off Ver
    Excel 2007
    Posts
    39

    Re: Comments, can they be programmed?

    Hello RomperStomper,

    Thanks for the reply but it did not change, same result, stops at the 3rd code. What is funny is that it works down through with codes 1-3 and anything after that it just using the 3rd meaning not matter how far down you go.

  7. #7
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Comments, can they be programmed?

    Could you post a workbook showing that? I don't see how that's possible at first glance.

  8. #8
    Registered User
    Join Date
    04-15-2009
    Location
    morristown, ny
    MS-Off Ver
    Excel 2007
    Posts
    39

    Re: Comments, can they be programmed?

    Here you go

  9. #9
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: Comments, can they be programmed?

    Probably the quickest way to convert the code would be to use a dynamic named Range.

    Name: CodeRange
    RefersTo: =OFFSET(Sheet1!$A$1,0,0,COUNTA(Sheet1!$A:$A),2)

    and then use change the line to
    Please Login or Register  to view this content.
    This assumes that there is nothing below the codes in Sheet1! A:A and that there are no blank rows in between data rows.

  10. #10
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: Comments, can they be programmed?

    I just thought of something else. For this to work there must be an existing entry in the Code/Meaning list.

    If you have an existing list of codes (say in D1:D100) that you want comments added to:
    1) make a complete list of codes/meanings
    2) alter the Change event code to reflect the range of the C/M list.
    3) run this from a normal module.

    Please Login or Register  to view this content.
    That should put comments in D1:D100.

    I've also been thinking...if the code/meaning list changes (particularly if the meaning of a code changes) a different approach would be better. (I have a notion involving Validation.) Is that the case?

    If the Code/Meaning list is not going to change, this is a good approach.
    Last edited by mikerickson; 10-30-2009 at 03:47 PM.

  11. #11
    Registered User
    Join Date
    04-15-2009
    Location
    morristown, ny
    MS-Off Ver
    Excel 2007
    Posts
    39

    Re: Comments, can they be programmed?

    Thanks

    The codes stay the same in this case but I have things turning in my head now about the possiblity of the "Validation" you write about.

  12. #12
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: Comments, can they be programmed?

    The basic idea is that, using Validation, you can have a message pop-up when you select a cell. By (automaticaly) copying the Validation from a MasterList Cell to the cells of interest, one can change all the validation messages just by altering the Validation of the Master Cell, while using the "Change all the same validation" option.

    The down side is that one has to actualy select the cell to see the message (Comments only require a hover), plus one has to dismiss the pop-up message by pressing Enter.

    With a static Code/Meaning list, Comments seems the way to go.

    When I get off work, I'll look into the sheet you posted in #8 to see what I can see.

  13. #13
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Comments, can they be programmed?

    Your workbook works fine for me making the change I suggested. Are you sure you changed the line exactly as I posted it?

  14. #14
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Comments, can they be programmed?

    You can do this with a UDF:
    Please Login or Register  to view this content.
    Then in F2 and copy down,

    =SetComment(E2, VLOOKUP(E2, $A$2:$B$8, 2))
    Entia non sunt multiplicanda sine necessitate

  15. #15
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: Comments, can they be programmed?

    Altering the Change event in the posted workbook to
    Please Login or Register  to view this content.
    fixed the problem.

    I added a named Range CMList refersto: Sheet1!$A$1:$B$8 and changed that line to use the Named Range instead.
    If the list needs to be expanded, the Name will adjust if blank rows are inserted into the middle of the list.

    I also altered the code to acomidate more than one cell being added to column C. (e.g. copy/pasting a range)

    I also added a section that, if the CMList is altered, the comments will be updated with the new meanings.
    Please Login or Register  to view this content.
    Attached Files Attached Files

  16. #16
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: Comments, can they be programmed?

    Shg, that's a nice UDF.

    (Who says UDF's can't "change the environment"? )

  17. #17
    Registered User
    Join Date
    04-15-2009
    Location
    morristown, ny
    MS-Off Ver
    Excel 2007
    Posts
    39

    Thumbs up Re: Comments, can they be programmed?

    Thanks folks,

    I'll mark this as solved
    Last edited by ed ayers315; 10-31-2009 at 09:08 AM. Reason: Solved

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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