Free Microsoft Excel 2013 Quick Reference

mouse cursor possition

Is any code how to move mouse cursor possition to some possition?
Thank you.

Post your answer or comment

comments powered by Disqus
Hello, Im setting up some buttons that open a UserForm, is there any way of making it open them next to the mouse cursor?


Does anyone know how to remove or hide the mouse cursor entirely when a specific worksheet is activated?

thanks for any help

Hi everyone,

I would like to change A1 cell's Interior.ColorIndex to red color and A1's font format to Italic, while mouse cursor on top of A1 cell.

Can i do it with a VBA code or any different way to do it?

Thanks a lot.

For a funny example:

Sub CursorOnA1() 
    If MouseCursor OnTopOf [A1] Then 
        With [A1] 
            .Interior.ColorIndex = 3 
            .Font.Italic = True 
        End If 
    End If 
End Sub

I have been learning to manipulate shapes in VBA and have come across a problem that I can't quite crack. I am attempting to have a worksheet shape autocenter itself on my mouse pointer as I move the mouse. It nearly works, but the shape does not quite land on the mouse cursor as it should - it is offset down and to the right.

I know that the problem lies within the difference between the values returned for the mouse position (the entire Excel Window) versus the position returned for the shape object (the worksheet Window) [Due to the toolbars and row 'header'] but I just can't seem to find a proper solution for determining the proper 'offset' factor.

Can someone point me in the right direction?

I've attached the code I have so far below:

Sub MouseMoveObjectTest()
Dim lngCurPos As POINTAPI
For Each sp In Worksheets("Sheet1").Shapes
Set a = Worksheets("Sheet1").Shapes.AddShape(92, 50, 50, 20, 20)
a.Name = "Oval2"
a.Fill.ForeColor.SchemeColor = False
GetCursorPos lngCurPos
' Find the Center of the Stationary and Moving Object
CenterRowStationary = lngCurPos.Y
CenterColStationary = lngCurPos.x
CenterRowMoving = Shapes("Oval2").Top + Shapes("Oval2").Height / 2
CenterColMoving = Shapes("Oval2").Left + Shapes("Oval2").Width / 2
MovementSpeed = 1.25
' Now comes the hard part.  I want the object to follow a straight path to the stationary
' object, so I will need to use Right Triangle Math to do this.
' First, I need to determine the Hypotenus of the Right Triangle give the height and width
' of the right triangle
TriangleHeight = Abs(CenterRowStationary - CenterRowMoving)
TriangleWidth = Abs(CenterColStationary - CenterColMoving)
TriangleHyp = Sqr(TriangleHeight ^ 2 + TriangleWidth ^ 2)
' Ok, now I will need to use the movement speed (which is the hypotenuse of a smaller
' right triangle within the larger right triangle above) to determine the height and width
' of this new triangle.  These values are directly proportional to the values in the above
' triangle.
If TriangleHeight = 0 Then
NewTriangleHeight = 0
NewTriangleHeight = (TriangleHeight / TriangleHyp) * MovementSpeed
End If
If TriangleWidth = 0 Then
NewTriangleWidth = 0
NewTriangleWidth = (TriangleWidth / TriangleHyp) * MovementSpeed
End If
' These new values are the row and column adjustment factors we will use to move
' the object.
With Shapes("Oval2")
If (.Top + Shapes("Oval2").Height / 2) > CenterRowStationary Then .Top = .Top - NewTriangleHeight
If (.Top + Shapes("Oval2").Height / 2) < CenterRowStationary Then .Top = .Top + NewTriangleHeight
If (.Left + Shapes("Oval2").Width / 2) > CenterColStationary Then .Left = .Left - NewTriangleWidth
If (.Left + Shapes("Oval2").Width / 2) < CenterColStationary Then .Left = .Left + NewTriangleWidth
End With
End Sub


How do I stop the input cell from jumping to the mouse cursor?

Hello everybody!
I would like to change the mouse cursor when the pointer passes over (without clicking) some cells which have double-click-event script attached.
I know how to change the cursor with a custom one. The pb is for me to identifie that the pointer is over the cell so as to launch the cursor change macro (and reverse when going over another cell).
Excel does that, for ex, with commented cells but can VBA do it also??
Any tips?

In Excel the gridlines clutter up the look of the screen. But they are very
useful in knowing where to click to make changes and select cells. I would
like to have the gridlines be invisible except in a floating area around the
mouse cursor.

This post is a suggestion for Microsoft, and Microsoft responds to the
suggestions with the most votes. To vote for this suggestion, click the "I
Agree" button in the message pane. If you do not see the button, follow this
link to open the suggestion in the Microsoft Web-based Newsreader and then
click "I Agree" in the message pane.

I am trying to find the method required to change the mouse cursor from a
hand shape to a pointer, for a check box which was created as a shape. Can
someone please help?

Message posted via

Using office 2003 is it possible to copy, paste and print a screen with the
mouse cursor showing? If not where can I get copies of all mouse cursor
shapes to use in pupil instruction manuals?

currently, the sheet have two buttons.
i press one button. then,,,

i want to move the mouse cursor the other button.

*** Sent via Developersdex ***

Where can I get a list of all the mouse cursors, such as Autofill, Move, Copy?

Hi nd many thanks in advance!!

I have a CommandButton and a macro attached to his command.
when I press the command the macro starts runing.
But how can I put my mouse cursor, I mean my mouse pointer somewhere, "say nowhere, say on range("A1")

I can put my selection on:
range("A1") using HTML Code:

I can avoid at the same time 

	HTML Code:

if I need to keep my selection always on Range("A1").

But what happen with the mouse pointer.
My CommandButton is on range("D4") and once pressed my mouse pointer is still over the command button.
Disturbing my spreadsheet view.


is there vba code to simulate the action of moving the mouse cursor and left click/right click of the mouse?

thanks a lot


I have been having an issue with one of the employee's excel programs in my office. We are running the 2007 edition. When opening a document in excel the cursor completely disappears. It still has full functionality (if you can figure out where it is).

One odd thing I just noticed is if you have excel open, then open up my documents, the cursor is no longer visible there either. However when excel isn't open the cursor is visible.

I have searched for an answer to this problem, however I have not been able to find one.

I have tried opening excel in safe mode, updating video drivers, and turned down the hardware acceleration on the chipset.

Any opinions would be extremely helpful, I will be checking frequently and trying to resolve this issue quickly because it is making the employee's work impossible.



Hi all
I wish to write my own digitizing program where I paste a scanned graph into an Excel worksheet and then use mouse events like Mousmove and Mousedown get the coordinates of any point on the scanned image.

Please can somebody supply a simple example in VBA showing me how obtain the coordinates of the mouse cursor.

I refer to the following MSDN web page

Many Thanks

Hi all, I have a problem.

I have a UserForm with an Image on it that serves as a button. I need it to change to a second image when the mouse cursor goes over it. Is this possible?

Thanks in advance


Hello. I would like to create an excel spreadsheet with several highlight-able buttons within certain cells. What I would like to do with these buttons is the following: When a user highlights one of these buttons with the mouse cursor, a macro will run and display a set of results to the user; these results will continue to be displayed so long as the user continues to hold the mouse cursor over that button (the results in this case would be a graph of data relative to the location of the highlighted button). When the user moves the cursor off of that button, the data previously displayed will disappear until the user highlights that button again. I can write the graphing macro myself, but I need help with the button-highlighting run-macro functionality described above. Does anyone know how to do this? Any help would be greatly appreciated - thank you.

I track my 401K with an excel spreadsheet that contains the date and price of five funds. I chart the funds percent change by date on a line chart with the category axis set to time-scale. I’ve noticed on charts that are “sized with window” hovering the mouse cursor over data points on the left or center displays the data value as expected, but near the right side of the chart the value of the data is not displayed when the cursor is hovered over a data point. After a lot of troubleshooting, I discovered that if I uncheck the “sized with window” view, I can hover over any point and obtain the data value. Is this a “feature” of the “sized with window” or something I’ve missed in setting up the chart? XY charts do not seem to exhibit this “feature”.

When I go into excel - doesn't matter whether new or saved document, if I move the mouse cursor the cells all highlight blue, I can't type anything. Someone recommended that it may be a 3 button mouse where the middle button is being pressed - but the mouse is a standard two button mouse.

Hope you can help - I am desperate

Thanx in advance

Using MS Excel 2003. Highlighted cell for editing is moving on it own to the
cell where ever the mouse cursor is located. Is this normal?

Using Excel, saving in latest Office version (in 2008) and saving in old
formats, how do I enter information in a cell which can be shown by waving
the mouse cursor over it? I would want the cell contents to be either
printable or not printed by applying a small number of keystrokes which could
be explained easily to other users.

If I open an Excel 2003 x-y scatter line chart with multiple (x,y) line
graphs (or open a graph that was saved under Excel 2007), and I move the
mouse over the various lines (some of them may be close to each other) then
there is an x 'offset' in the location of the mouse and when Excel recognizes
a line graph and displayes the line title with a little message underneath
the mouse cursor. Another way to explain thsi behaviour is if you try to
click at a particular line graph, it may not select it, it may select a
different line graph that is located left to where the mouse is.

This is very agonzing when trying to analyze data, which I and my collegues
need to do. Excel 2007 is therefore almost useless to us. Also if you, e.g.,
try to change the color or appearance of the line, you may not be able to
select it easily.

It is as if the internal coordinates of the chart area are not tracked
properly to the mouse coordinates when the mouse moves over the chart area.
Possibly both the x and y coordinates have an 'offset'.

I have update to the service pack 2. Are there further Excel-only updates

Hi guys,

I have a looping function in the SheetActivate event of the workbook and sometimes users switches sheets before the loop is finished. In this way the Workbook seems to hang.

I need help on how to change the mouse pointer when I switch sheets in my Excel workbook so that I can make sure that the loop functions are finished before the user switches again to other sheets.

Or can anyone suggest a better way to do it?

Thanks and best regards,


In VBA, how do you display a message(dialog box or comment) when your mouse cursor is over an object (button for example)?

for example: if I put my cursor over the "B" in the toolbar, it will displays "Bold".
I would like to know How I could do/progam that.

Thank you very much for your help


No luck finding an answer? You could always try Google.