+ Reply to Thread
Results 1 to 6 of 6

Display names when a cell is clicked

  1. #1
    Registered User
    Join Date
    05-08-2014
    Location
    England, UK
    MS-Off Ver
    Excel 2013
    Posts
    46

    Display names when a cell is clicked

    Hi Everyone,

    Thank you for taking the time to read this, I have given a small example of what I intend to achieve in an attached file.

    I want to be able to display the names of the pupils who meet my criteria.

    Example in Test 1, there were 3 pupils who achieved an "A" from class 2.
    I need to see in a message box Sally, Romeo and Wendy.

    I would be greatful for any help or starting point as I think this is done in visual basic for which i have no expereince in? Also if possible an explanation of what is happening in the code would be beneficial as i can gain an insight and appreciate this aspect of excel.

    Thank you.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Display names when a cell is clicked

    Formula for D11, Entered Using Ctrl Shift Enter.

    =SUM(IF(class=$C11,1,0)*IF($L$3:$O$16=D$10,1,0))
    Fill Right and then Down.


    Right Click On Your Sheet Name At the Bottom Of Excel and Select View Code
    Paste this code in the module that opens and close it.

    Please Login or Register  to view this content.
    This will place your list of names in A1.

    Please Login or Register  to view this content.
    This will place your list of names in A1 and display the names in a message box

    Please Login or Register  to view this content.
    This will place your list of names in A1 and display the names in a message box


    ********************************************************************************************************

    This uses a Comment instead of a message box.


    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by mehmetcik; 12-21-2018 at 10:27 PM.
    My General Rules if you want my help. Not aimed at any person in particular:

    1. Please Make Requests not demands, none of us get paid here.

    2. Check back on your post regularly. I will not return to a post after 4 days.
    If it is not important to you then it definitely is not important to me.

  3. #3
    Registered User
    Join Date
    05-08-2014
    Location
    England, UK
    MS-Off Ver
    Excel 2013
    Posts
    46

    Re: Display names when a cell is clicked

    Thank you mehmetcik

    I will give this a go, I really appreciate your help sir.

  4. #4
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Display names when a cell is clicked

    Try this in the Sheet1 module:

    Please Login or Register  to view this content.
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  5. #5
    Registered User
    Join Date
    05-08-2014
    Location
    England, UK
    MS-Off Ver
    Excel 2013
    Posts
    46

    Re: Display names when a cell is clicked

    Thank you xladept

    That is superb and works like a treat. I'm going to try and figure out what is happening in the code so I can apply this onto a larger scale.
    Much appreciated sir.

    Best wishes always

  6. #6
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Display names when a cell is clicked

    You're welcome and thanks for the rep!

    You should be able to expand your tables in place

+ 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] Use Vlookup as macro on clicked cell and all cell values below that clicked cell
    By harman83 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 11-06-2015, 12:58 PM
  2. [SOLVED] Macro to make list box menus auto-display when cell is clicked?
    By dgibney in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-12-2014, 11:52 AM
  3. [SOLVED] Load web image when cell holding URL is clicked/double-clicked
    By jchamber00 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-20-2013, 09:13 PM
  4. [SOLVED] code so that when a cell is clicked, a tick mark goes in the cell that was clicked
    By behnam in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-08-2013, 01:17 PM
  5. Display contents of cell in another only when clicked on
    By jshaw82 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 01-20-2013, 03:56 PM
  6. Replies: 4
    Last Post: 03-23-2006, 03:40 PM
  7. Change cell value when right-clicked/double-clicked
    By grime in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-17-2005, 09:05 AM

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