Please Note: This article is written for users of the following Microsoft Excel versions: 97, 2000, 2002, and 2003. If you are using a later version (Excel 2007 or later), this tip may not work for you. For a version of this tip written specifically for later versions of Excel, click here: Resizing Checkboxes.

Resizing Checkboxes

by Allen Wyatt
(last updated April 28, 2016)

8

When working in VBA, one of the things you can create is known as a "user form." These forms provide you with the ability to essentially create your own dialog boxes. You can add many different types of controls to a user form, if desired. For instance, you can add labels, text boxes, drop-down lists, radio buttons, and many other controls. Some of the controls you can resize; others you cannot. One that you cannot resize is a checkbox. While you can modify the font size used for the label next to the checkbox, you cannot resize the checkbox itself.

If you find the checkboxes in your user forms too small for your taste, you can "work around" them by simulating a checkbox. You do this by actually creating a label instead of a checkbox. Then, change the properties of the label so that it has a transparent background, and that the font being used is Wingdings. You should also make sure that the font is set to a large size, such as 20 or 26 points.

Now, double-click on your label, which should open a code window. The event that you are programming is the Click event for the label, which means it will be executed whenever the label is clicked. Use this as your code:

Private Sub Label1_Click()
    If Label1.Caption = Chr(254) Then
        Label1.Caption = Chr(168)
    Else
        Label1.Caption = Chr(254)
    End If
End Sub

In the Wingding font, Chr(254) is box with a checkmark, and Chr(168) is a box with no checkmark. When you execute the user form and click on the label, it switches between an empty box and a checked box. You can also add other code to the Click event that performs other tasks, as necessary.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (2282) applies to Microsoft Excel 97, 2000, 2002, and 2003. You can find a version of this tip for the ribbon interface of Excel (Excel 2007 and later) here: Resizing Checkboxes.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He  is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Centering a Paragraph with the Keyboard

Need a quick shortcut that you can use to center your paragraph between the margins? The answer is here.

Discover More

Changing ToolTips for a Macro Button

Want to change the ToolTip that appears when you hover the mouse over a button on a toolbar? It's a bit more involved ...

Discover More

Removing Styles from the Quick Access Toolbar

Got something on the Quick Access Toolbar that you don't need there any more? Here are two quick ways to get rid of that ...

Discover More

Excel Smarts for Beginners! Featuring the friendly and trusted For Dummies style, this popular guide shows beginners how to get up and running with Excel while also helping more experienced users get comfortable with the newest features. Check out Excel 2013 For Dummies today!

More ExcelTips (menu)

Skipping Hidden Rows in a Macro

As your macro processes information in a worksheet, you may want to make sure that it skips over rows that are hidden. ...

Discover More

Expiration Date for Excel Programs

If you use Excel to create a macro-based application, you may want to make sure that your programs cease working after a ...

Discover More

Preserving the Undo List

The undo list can be a lifesaver when working in a macro. Unfortunately, the undo list is not preserved when you run a ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is seven more than 3?

2017-09-30 16:59:49

Sam

Hello Allen, thanks for posting this fix. I don't know if you have time to help me but am not able to insert the Label in a cell. the only way that worked for me was creating a userfrom in VBA and inserting a lable then your code. But then when I "play" that userform it shows in my excel in a detached window like and no way to insert it in a particular cell or even fix its location.

Hope u can help

Sam


2014-11-26 04:35:10

RJ

Thanks for this tip!

I also have the same problem>> After creating a successful checkbox this way, is there a way to copy and paste the checkbox many times while copying the VB code while actually having it automatically adjusting the new label name?

Appreciate your help!


2014-08-23 11:45:10

shelley


Am I the only one who doesn't know what VBA is?


2014-08-22 11:19:36

Leigh

This works great but I have a workbook with about 300 checkboxes and several are added and deleted every week. The people responsible for maintaining the workbook can't be counted on to add these properly so I would have to spend several hours a week "fixing" what they broke.
Is there a less cumbersome (ie: idiot proof) method?


2014-08-21 11:22:30

Jolene

I am having the same issue as Rami. I need to copy this a bunch of times. is there a way to easily have it copy and update? Also I had it working then went to copy it once and when I take excel off of design mode I can no longer click the cell that I have added the Label to?? any ideas.

I have tried deleteing the label and creating a new one but same thing happened?


2014-02-10 19:57:20

Denise

Thank you so much, I was tearing out my hair on this. Won't hear any more nagging about tiny checkboxes on certain forms--they are gigantic now. I love a creative solution.


2014-01-08 18:07:22

Rami

Thanks! this was indeed very helpful.

Quick question: After creating a successful checkbox this way, is there a way to copy and paste the checkbox many times while copying the VB code while actually having it automatically adjusting the new label name?

I basically don't have to change those 4 lines of code 500 times adjusting them for label1, label2, label3, etc..

Thanks!


2013-11-24 11:41:19

Scooter

Wow! I have been looking for a way to do this for over a year and just found this on your website. This worked great! Thank You!!!


This Site

Got a version of Excel that uses the menu interface (Excel 97, Excel 2000, Excel 2002, or Excel 2003)? This site is for you! If you use a later version of Excel, visit our ExcelTips site focusing on the ribbon interface.

Newest Tips
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.