Changing the Cursor in VBA

The Application object has a Cursor property that you can use to change the appearance of the cursor in your VBA programs. You use it like

Application.Cursor = xlWait

The valid settings are
xlDefault
xlBeam
xlNorthwestArrow
xlWait

Be sure to set it back to xlDefault when you’re done monkeying with it.

Posted in Uncategorized

2 thoughts on “Changing the Cursor in VBA

  1. I am using VBA and I want to change the cursor when it passes over a ‘label’ to the Windows default hand and it is not in the drop down list in ‘properties’. How can I do this?

    Thanks
    Roger

  2. Roger –

    Userform controls and worksheet controls from the Controls Toolbox have a MousePointer property, with a set of built-in options (more than the application.cursor choices above). If the option you want isn’t there, set MousePointer to 99 – fmMousePointerCustom, then use the MouseIcon property to pick out a graphic file to use.


Posting code? Use <pre> tags for VBA and <code> tags for inline.

Leave a Reply

Your email address will not be published.