×

How To Change The Mouse Cursor Icon In Your VBA Userform

By Chris Newman •  Updated: 02/20/17 •  4 min read
VBA Userform Change Mouse Pointer On Hover

Why Change Your Userform’s Cursor?

There may be certain instances where it makes sense to change the look of the mouse cursor to notify your users of a particular action. A classic case for this is when you hover over a button. Typically, your mouse cursor will change from the pointer arrow to a pointer hand.

VBA Userform Change Mouse Cursor

By default, Microsoft has picked a cursor type for each control available to add to a VBA userform. However, there are steps you can take to change the cursor image that appears while interacting with these controls. Here is a list of all the available Mouse Pointers you can use within your userforms

  • fmMousePointerDefault
  • fmMousePointerArrow
  • fmMousePointerCross 
  • fmMousePointerIBeam
  • fmMousePointerSizeNESW
  • fmMousePointerSizeNS
  • fmMousePointerSizeNWSE
  • fmMousePointerSizeWE
  • fmMousePointerUpArrow
  • fmMousePointerHourGlass
  • fmMousePointerNoDrop
  • fmMousePointerAppStarting
  • fmMousePointerHelp
  • fmMousePointerSizeAll
  • fmMousePointerCustom

Most of these should be self-explanatory but if you are unsure you can always test them out to see how they appear.

Userform Change Mouse Type

You’ll notice that one very important cursor image does not appear on this list and it is the Pointed Finger (aka Hand) icon shown in the image above with the green Accept buttons. I will discuss later on in this article how you can use the fmMousePointerCustom option to load a custom cursor icon. This will allow you to use any cursor icon you want.

How To Change the Mouse Pointer

Here are the basic steps to change which mouse pointer image displays while using a specific control in your VBA userforms.

  1. Ensure your userform is showing in the Visual Basic Editor (keyboard shortcut Alt + F11)
  2. Ensure the Properties Pane is visible (keyboard shortcut F4)
  3. Select the userform you wish to modify
  4. Within the Properties Pane, find the Property called MousePointer
  5. Select the mouse pointer image you would like shown when you hover over the control with your cursor (fmMousePointerDefault is the default option)
VBA Userform Change Mouse Pointer

Using A Custom Mouse Pointer

I you do not find any of the built-in mouse pointers suitable for your userform you also have the option to upload your own cursor icon. The steps to do this are as follows:

  1. Ensure your userform is showing in the Visual Basic Editor (keyboard shortcut Alt + F11)
  2. Ensure the Properties Pane is visible (keyboard shortcut F4)
  3. Select the userform you wish to modify
  4. Within the Properties Pane, find the Property called MousePointer and change it to the fmMousePointerCustom option
  5. Also within the Properties Pane, find the Property called MouseIcon and click the little gray box with three black dots that appear on the far right of the property
  6. Find the icon image you would like to appear (file type must be .ico or .cur)
VBA Userform Change Mouse Pointer On Hover

Where Do You Find The Hand Icon on The Web?

I had spent years trying to find a quality hand icon that would be compatible with Microsoft’s userforms. I dug through forums, articles, and everything in between but could only find pixelated hand icons that did not look like the current native hand cursor the Windows OS typically uses. 

About a year ago I finally found a file download that matched the quality I was looking for. I don’t have the slightest clue where I found it but I made sure to save several copies so I would never have to find it again. With this article, I also want to save you the pain of having to search for this gem.

VBA Userform Change Mouse Image To Hand Finger Point

Here is a direct link to download this cursor icon: Hand Cursor.ico

Userform Hand Cursor Icon

Keep Learning

Chris Newman

Chris Newman

Chris is a finance professional and Excel MVP recognized by Microsoft since 2016. With his expertise, he founded TheSpreadsheetGuru blog to help fellow Excel users, where he shares his vast creative solutions & expertise. In addition, he has developed over 7 widely-used Excel Add-ins that have been embraced by individuals and companies worldwide.