+ Reply to Thread
Results 1 to 4 of 4

How do i display a graph that will only display when a cell is clicked or cursor touches?

  1. #1
    Registered User
    Join Date
    01-30-2020
    Location
    Germany
    MS-Off Ver
    Excel 2016
    Posts
    34

    How do i display a graph that will only display when a cell is clicked or cursor touches?

    I need to display a line graph from 2 cell values (Vertical & Horizontal) but i am having some trouble with it.

    Is there any way to display the graph only when my cursor touches or clicks onto the cell?
    The cell values are required to have "V/m Vertical/Horizontal" included so the code will need to skip the String and extract the numbers.

    I have uploaded my vba file & code below. Any suggestions will be helpful. Thanks

    Please Login or Register  to view this content.
    Attached Files Attached Files

  2. #2
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,615

    Re: How do i display a graph that will only display when a cell is clicked or cursor touch

    Let me start from a comment: I don't understand why you thrown away a nice piece of work done by mehmetcik in previous thread https://www.excelforum.com/excel-pro...isplay-it.html
    He has shown you, that there can be single procedure to do all major work (it was called MinMax there) and the code for each button can be just a call to this procedure with an argument (like worksheet row).
    Now you went back to your code with all the work being done in each of the buttons code :-(

    To the merit:
    The simple solution, based on a registered macro consists of the procedure deleting a graph (if already exists) and re-creating it. The data to be displayed is passed in a named range.

    As there were no sample graphs to be obtained, I assumed that this: "I need to display a line graph from 2 cell values" means you need only graph from the last range clicked. (see the code below)
    If you need to have all ranges displayed the code shall be changed to only add a new series (and if only if needed - create a graph) - this approach is used in a workbook attached.

    So in a standard module a code:

    Please Login or Register  to view this content.
    And the procedures in the "Program sheet code with added calls to this procedure, like:

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Best Regards,

    Kaper

  3. #3
    Registered User
    Join Date
    01-30-2020
    Location
    Germany
    MS-Off Ver
    Excel 2016
    Posts
    34

    Re: How do i display a graph that will only display when a cell is clicked or cursor touch

    Greetings Kaper,

    The MiniMax function is not wasted. I just had a little issue with the way the properties are being layed out (different from the previous program) in my actual application. Do allow me to explain myself.

    Based on my understanding of mehmetcik's MiniMax function, it can only be used if the properties are layed out in a well arranged order (Just like my previous program) and thus reads the properties row by row.

    OGproperties.PNG

    Unfortunately, i realised that the properties given to me (company confidential) is layed out in a way like this instead:

    new properties.PNG

    Due to my limited understanding of the MiniMax's function i faced some trouble this scenario and therefore, i had to individually assign each cell in my program to each cell in the properties sheet. I may have underestimated the capabilities of MiniMax so do let me know if i can still use it in this application with the new property layout. Thank you.

    Best regards,
    Christian
    Last edited by trippyninjas; 02-27-2020 at 06:01 AM.

  4. #4
    Registered User
    Join Date
    01-30-2020
    Location
    Germany
    MS-Off Ver
    Excel 2016
    Posts
    34

    Re: How do i display a graph that will only display when a cell is clicked or cursor touch

    Hi Kaper,

    The program works well but i'm having some trouble understanding it. Is there a method to produce individual graphs for every set of horizontal & vertical values? Also, how do i manually set the x & y-axis range values of the generated graph?

    Best regards,
    Christian

+ 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. Display names when a cell is clicked
    By salimnore in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-21-2018, 10:27 PM
  2. Replies: 1
    Last Post: 07-20-2016, 11:48 AM
  3. Display cursor position in cell
    By Regina Rodler in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-06-2015, 07:55 AM
  4. [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
  5. [SOLVED] where ever cursor move around the sheets that value display in particular cell
    By Naveed Raza in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-04-2014, 06:39 AM
  6. 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
  7. [SOLVED] The cursor affects all cells it touches-how to correct?
    By Art Bair in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 01-05-2006, 03:35 PM

Tags for this Thread

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