How to get an Excel cell by Mouseposition

Posted on 2010-01-07
Last Modified: 2013-11-17
Hi all,

I try to get a cell (Excel.Range-Object), but I won't click the cell. The spreadsheet is activated and I have the coordinates of the mouse-position.

Is there a way to get the cell direct under the mouse position?
Question by:Datenkultur
    LVL 23

    Expert Comment


    Author Comment

    Thanks for your post, itkamaraj.

    I can't change the spreadsheet. I have a reference of the activesheet and I can use every event, but I have to find the cell without changing the map.

    I would like to select the cell unter the mousepointer without a user mouseclick.

    Accepted Solution

    I got a solution:

    I can select the cell by sending a simple mouseclick. But it will only work, if you change the mouseposition by code before.

    I did not tell, that I tried to select a cell behind a chart-object by clicking the chart-object. So excel selects the chart first. After that, i killed the chart and tried to select the cell under the actual mousepointer. Sending a mouseclick allways selected the old cell. After changing the mouseposition by code a little it worked. I think excel was looking for a mouse move, in oder to select another cell by click.


    Featured Post

    Maximize Your Threat Intelligence Reporting

    Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

    Join & Write a Comment

    Dealing with unintended Excel Active-X resizing quirks (VBA code simulates "self correction") David Miller (dlmille) Intro Not everyone is a fan of Active-X controls in spreadsheets (as opposed to the UserForm approach, the older Form controls …
    Introduction This Article is a follow-up to my Mappit! Addin Article (, it was inspired by an email posting I made to EUSPRIG (, I will briefly cover: 1) An overvie…
    This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.
    This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.

    731 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now