VBA Objects Properties and Methods in Excel

Home/Excel VBA/VBA Objects Properties and Methods in Excel

Understanding VBA Objects Properties and Methods in Excel is important, most of the programming languages today are Object Based Or Object Oriented Programming Languages. Although Excel VBA is not a truly object oriented programming language, it does deal with objects.

PREMIUM TEMPLATES LIMITED TIME OFFER

ON SALE80% OFF

50+ Project Management Templates Pack
Excel PowerPoint Word

Advanced Project Plan & Portfolio Template
Excel Template

Business Presentations Templates Pack
PowerPoint Slides

20+ Excel Project Management Pack
Excel Templates

20+ PowerPoint Project Management Pack
PowerPoint Templates

10+ MS Word Project Management Pack
Word Templates


In this Section:

What are Objects?

Most of the programming languages today are Object Based Or Object Oriented Programming Languages. Although Excel VBA is not a truly object oriented programming language, it does deal with objects.
VBA object is something like a thing that has certain functions, properties, and can contain data or child objects.

In real world everything is an object. For example, House is an Object, Windows and Doors,etc… are child objects of the House. And House is having some characteristics or properties such as Color, Height, Number of Floors,etc.., and it also have some Events, such as Door Open, Door Close, etc….

Similarly, An Excel Worksheet is an object, and a Range or Cells in a worksheet are child objects of worksheet, Worksheet contains several Properties, Methods and Events.
You can go to the code window to view the VBA objects, the upper left drop-down list of the code window contains the list of objects and the right side drop-down list contains the associated objects.

Objects-Example-1

What are Properties?

Properties are the characteristics of an Objects which can be measured and quantified, in the above example House is having properties like Width, Height, Color, etc…
Similarly, Excel Objects are having several properties which can be measured and quantified.

For example, a Range Objects is having Properties like Value,Font.ColorIndex, Interior.ColorIndex,etc…

Sub sbExampleRangeProperties()
Range("A1").Value = 25
Range("A1").Interior.ColorIndex = 5
End Sub

Objects-Example-2

What are Methods?

Methods are the actions that can be performed by an an Objects or on an Object. In the above Hose example, paintaing is a Method, building a new room is a method.
Similarly, if you want to select a range, you need Select method. If you want to copy a range from one worksheet to another worksheet you need Copy method to do it.

The following example Copies the data from Range A1 to B5.

Sub sbExampleRangeMethods()
Range("A1").Select
Selection.Copy
Range("B5").Select
ActiveSheet.Paste
End Sub

Objects-Example-3

VBA Objects Properties and Methods in Excel – Object Browser?

Object browser is a very helpful tool available in VBA, which helps you to veiw all available Objects in the Excel VBA. Click on the objects browser in the code window to view all the available Excel VBA objects and its associated Properties and Methods.
Objects-Example-4



Related Resource External VBA Reference
Excel VBA Reference Project Management Reference
VBA Reference:
Excel Reference:
By |May 26th, 2013|Excel VBA|9 Comments

About the Author:

PNRao is a passionate business analyst and having close to 10 years of experience in Data Mining, Data Analysis and Application Development. This blog is his passion to learn new skills and share his knowledge to make you expertise in Data Analysis (Excel, VBA, SQL, SAS, Statistical Methods, Market Research Methodologies and Data Analysis Techniques).

9 Comments

  1. NAGESWARA RAO January 6, 2015 at 2:37 PM - Reply

    KEEP IT UP

  2. Yogarajah October 6, 2015 at 8:44 AM - Reply

    Very simple explanation of objects,Properties and Methods in VBA. Congratulation.

  3. Nafis April 18, 2016 at 10:09 AM - Reply

    Thanks, deep explanation in very simple way. it clears the concept very easily.

    Thanks again.

  4. hemant June 11, 2016 at 2:38 PM - Reply

    Good, simple explaination

  5. Ashok October 22, 2016 at 10:01 AM - Reply

    It is very easy and simple to understand the subject

  6. Vignesh May 8, 2017 at 4:41 PM - Reply

    Nice explanation

  7. Sivaji May 19, 2017 at 11:47 PM - Reply

    Thank u sooo much dear gud explanation

  8. Remmy August 8, 2017 at 12:39 PM - Reply

    I bought a massive VBA book on Amazon and having read it over and over again, it still couldn’t understand properly what these things are. You, however, nailed it in a few word. Thank you.

    • PNRao August 8, 2017 at 2:18 PM - Reply

      We are glad to hear that you this useful.
      Thank you very mach!

Leave A Comment


Related pages


tick box in excelexcel vba create rangeexcel vba hyperlinkexcel macro rowsexcel vba saveas fileformatoption button excelexcel vba option buttonhow to find password of protected sheet in exceldatabase dmlexcel 2007 lookup functionlist of shortcut keys in excelif functions in excel 2013how to hide excel rowsexcel merge sheets into one workbookexcel macro save as pdfeasy excel vbaadvanced pivot table in excel 2007example excel formulasvba learningmicrosoft excel vba tutorialsql questions and answers for experiencedexcel vba formula arrayremove protection from excel 2010 without passwordvba run sql queryhow to build excel macrosexcel implementation plan templatepivot table setupexcel vba sort arrayexcel vba range selectvba last rowexcel macro samplesvba string arrayexcel add multiple rowsactivesheet vbaexcel iferror functioninteractive dashboard excelvba userform templatesexcel vba copy sheet to endexcel vba listbox rowsourceinstr excelclose file vbaexcel shortcut to delete rowvba excel hyperlinkvba filter functionvlookup basicshow to use hlookup in excel 2013simple vbscript examplevlookup two worksheetsexcel to kml macroexcel macro to open files in a folderchoose function excelvba handbook pdfexcel vba integermicrosoft word project management templateobjects in excel vbaexcel vba read text filevba functions excelmacro to delete rowsrunning macros in excelhow to make vlookup in excel 2007combine excel worksheets into onevba closeworkbook passwordlen function in vbavba goto statementvba select caseremoving empty rows in exceluserform combobox vbahow to use autofit in excelhow to work on pivot table in excel 2010remove password from excel workbook 2010iif in excel