How To Change The Mouse Cursor Icon In Your VBA Userform

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 in a VBA userform. However, there are steps you can take to change the cursor image that appears while interacting with these controls. Here are 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 appears 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 typcially 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

How Do I Modify This To Fit My Specific Needs?

Chances are this post did not give you the exact answer you were looking for. We all have different situations and it's impossible to account for every particular need one might have. That's why I want to share with you: My Guide to Getting the Solution to your Problems FAST! In this article, I explain the best strategies I have come up with over the years to getting quick answers to complex problems in Excel, PowerPoint, VBA, you name it

I highly recommend that you check this guide out before asking me or anyone else in the comments section to solve your specific problem. I can guarantee 9 times out of 10, one of my strategies will get you the answer(s) you are needing faster than it will take me to get back to you with a possible solution. I try my best to help everyone out, but sometimes I don't have time to fit everyone's questions in (there never seem to be quite enough hours in the day!).

I wish you the best of luck and I hope this tutorial gets you heading in the right direction!

Chris :)