Excel Macro Tutorial : VBA Control Property

.

In last post Excel Macro Tutorial : Visual Basic Editor in Excel we saw how to add different Controls in your Excel Macro. To Read All the Excel Macro Tutorial Click Here.
 
Each and Every VBA controls has their own by default properties. Like Name of the Control, height, width, Caption, color, background, font color etc. In Excel other than All these VBA controls like Command Button, Radio Button, Textbox etc. Worksheets also has its own properties.
 
So let’s see how we can see and change the properties of a control added in your excel Sheet.

Step 1. In below Excel Sheet we have 2 controls, 1 Command Button and One Combobox

Command Button and Combobox



Press Right Click on the Control for which you want see or change the Properties of that Control.
 
Step 2. Click on Properties

properties-window

Step 3. Property Window is visible now. On top you can see all the Controls added to your Sheet along with the Sheet Name. By default that control will be selected on which you had right clicked and selected the “Properties”. From here you can select any of the Control for which you want to view the Property.

properties-window

Step 4. For Example: In the above Picture you can see Property of the CommandButton1 is displayed.

properties-window

On Top you can see there is a Property called “Name”. This is the Name of that Control. This should always be unique in the Excel Workbook as each and Every Control is uniquely identified by this name.
When you add a new Control is added to the Sheet, by default a unique name is given to that control like RadioButton1, RadioButton2 etc.

It is always a good habit to change the name of your Controls based on it’s functionality. So that when you have lot’s of controls then it’s easy to remember the control names while writing code.

Similarly you can Change following ActiveX Control Properties:

1. VBA Textbox Property
2. VBA Combobox Property
3. VBA CheckBox Property
4. VBA ListBox Property
5. VBA ScrollBar Property
6. VBA Spin Button Property
7. VBA Radio Button Property (Option Button property)
8. VBA Label Property
9. VBA Toggle Button Property

……. and so many other ActiveX Controls

Note: Here I have not given Screen Shots and Steps for all the Properties of all the Controls. But if you are facing any issues in Properties of any Control or any other Issues or Solution related to Excel, just Give a reply to this post with your doubt or question or email me at Info@learnexcelmacro.com

 
To Check out more Excel Macro Tutorials, visit Excel Macro Tutorial

Buy a coffee for the author

Adsense

Download FREE Tools and Templates

There are many cool and useful excel tools and templates available to download for free. For most of the tools, you get the entire VBA code base too which you can look into it, play around it, and customize according to your need.

Convert PDF Tables to Excel with VBA | Step-by-Step Guide
Convert PDF Tables to Excel with VBA | Step-by-Step Guide

Convert PDF Tables to Excel with VBA | Step-by-Step Guide How to Convert PDF Tables to Excel Using Excel VBA (Macros) Extracting data from PDF tables into Excel can be tedious, but with Excel VBA (macros), you can automate this process and save time. This guide will...

Dynamic Arrays and Spill Functions in Excel: A Beginner’s Guide
Dynamic Arrays and Spill Functions in Excel: A Beginner’s Guide

In today's tutorial, we'll be diving into the exciting world of dynamic arrays and spill functions in Office 365 Excel. These features have revolutionized the way we work with data, providing a more flexible and efficient way to handle arrays. I am going to explain...

How to Declare a Public Variable in VBA
How to Declare a Public Variable in VBA

While programming in VBA sometimes you need to declare a Public Variable that can store the value throughout the program. Use of Public Variable: Let's say you have 4 different Functions in your VBA Code or Module and you have a variable that may or may not be...

What is Excel Formula?

Excel Formula is one of the best feature in Microsoft Excel, which makes Excel a very very rich application. There are so many useful built-in formulas available in Excel, which makes our work easier in Excel. For all the automated work, Excel Macro is not required. There are so many automated things can be done by using simple formulas in Excel. Formulas are simple text (With a Syntax) which is entered in to the Excel Worksheet Cells. So how computer will recognize whether it is a formula or simple text? Answer is simple.. every formula in Excel starts with Equal Sign (=).

You May Also Like…

1 Comment

  1. Nag

    i want how to retrive data through the commandbutton in hyperion essbase database and Planning application code for command button pls rply ASAP

    Reply

Trackbacks/Pingbacks

  1. Learn Excel Macro Excel Macro Tutorial : How to write Excel Macro - Your First Excel Macro - [...] 5. How to add different types of controls like Text Box, Radio button, button etc. in Excel 6. VBA…

Submit a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Join and get a FREE! e-Book

Don't miss any articles, tools, tips and tricks, I publish here

You have Successfully Subscribed!

Pin It on Pinterest