+ Reply to Thread
Results 1 to 7 of 7

Detect cell address of cell directly under mouse pointer

  1. #1
    Forum Contributor
    Join Date
    04-03-2007
    Location
    Auckland, New Zealand
    MS-Off Ver
    2007
    Posts
    137

    Detect cell address of cell directly under mouse pointer

    Hi,
    I've a sheet that presents the profitability of sales locations in a geographic layout (similar to Tables in a restaurant), each sales location is a cell, with roughly 1,600 locations presented. Each location is colour coded based on performance / measure, in a basic thermographic way [e.g. dark blue for very poor, solid red for high performance] with users being able to change metrics and re-colour cells accordingly.

    The sheet is already information rich, but I'm wanting to detect the cell address directly under the pointer and populate a text box or other cell based on the value in the cell directly below the mouse pointer.

    My question is; Is there a simple way of detecting the mouse position on the XL Grid? nb. Want to avoid having to activate cell beneath pointer.


    Any advice greatly appreciated.

  2. #2
    Valued Forum Contributor JeanRage's Avatar
    Join Date
    03-02-2009
    Location
    Nice, France
    MS-Off Ver
    Excel 2003
    Posts
    705

    Re: Detect cell address of cell directly under mouse pointer

    Hi,

    Could the cell comment be part of the solution ...?

    HTH

  3. #3
    Valued Forum Contributor JeanRage's Avatar
    Join Date
    03-02-2009
    Location
    Nice, France
    MS-Off Ver
    Excel 2003
    Posts
    705

    Re: Detect cell address of cell directly under mouse pointer

    For the sake of an initial test ...

    Please Login or Register  to view this content.
    HTH

  4. #4
    Forum Contributor
    Join Date
    04-03-2007
    Location
    Auckland, New Zealand
    MS-Off Ver
    2007
    Posts
    137

    Re: Detect cell address of cell directly under mouse pointer

    Thanks for the advice JeanRage.
    I'm hoping to avoid activating the cell(s) beneath the pointer.
    I've looked at some the methods for calculating mouse x/y co-ords which might look promising except that where the Xl grid is scrolled the x/y is only calculated from the top left of the screen & not top left of xl grid..

    Hoping to add the output to a dashboard without letting users trash it.
    Locking cells might be the answer..

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

    Re: Detect cell address of cell directly under mouse pointer

    Your problem is going to be detecting the mouse movement to update the textbox, I think, which will basically involve subclassing the Excel window (not for the faint hearted).
    Remember what the dormouse said
    Feed your head

  6. #6
    Valued Forum Contributor JeanRage's Avatar
    Join Date
    03-02-2009
    Location
    Nice, France
    MS-Off Ver
    Excel 2003
    Posts
    705

    Re: Detect cell address of cell directly under mouse pointer

    Quote Originally Posted by Jbentley View Post
    Thanks for the advice JeanRage.
    I'm hoping to avoid activating the cell(s) beneath the pointer.
    I've looked at some the methods for calculating mouse x/y co-ords which might look promising except that where the Xl grid is scrolled the x/y is only calculated from the top left of the screen & not top left of xl grid..

    Hoping to add the output to a dashboard without letting users trash it.
    Locking cells might be the answer..
    Hi,
    You do not have to activate the cell beneath the pointer in order to read the comment attached to the cell located beneath the pointer ...

    HTH
    Last edited by JeanRage; 10-29-2009 at 02:55 AM.

  7. #7
    Forum Contributor
    Join Date
    04-03-2007
    Location
    Auckland, New Zealand
    MS-Off Ver
    2007
    Posts
    137

    Re: Detect cell address of cell directly under mouse pointer

    Hi,
    Thanks both.
    I am of the faint hearted when it comes to intracies of vba so think I'll leave that one alone - maybe in some distant future when I upskill.

    I'll be wanting to dynamically change the 'text' dependending on various user selections, and do not necessarily want to update 1,600 comment boxes each time.

    Cheers

+ 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