{"id":4183,"date":"2024-02-03T01:00:36","date_gmt":"2024-02-03T01:00:36","guid":{"rendered":"http:\/\/www.learnexcelmacro.com\/wp\/?p=4183"},"modified":"2024-02-03T01:00:36","modified_gmt":"2024-02-03T01:00:36","slug":"range-object-tutorial-in-excel-macro","status":"publish","type":"post","link":"https:\/\/vmlogger.com\/excel\/2024\/02\/range-object-tutorial-in-excel-macro\/","title":{"rendered":"Excel Macro Beginners – What is Range Object in Excel VBA"},"content":{"rendered":"
Dear readers,<\/p>\n
\nBefore we discuss the Range Object<\/strong> technically, let us see what is RANGE in excel?<\/i><\/strong> In a very simple manner if I define Range, I can say that RANGE<\/strong> is a collections of cells which are in a sequence.<\/i> This collection can have one or more than one cell.\n<\/p>\n \nAs I have defined, Range is a collection of cells, but why in a sequence? Suppose I have a combination of cells A1, B2, D7 and E9<\/strong>. Will I call this combination as a Range? No, I can not call this collection as a Range because these cells are not in a sequence. Now you know what is Range in Excel Workbook. To represent or access this cell range, the Object which is used in Excel VBA is called Range Object.<\/strong> Range Object is the most important and used Object in excel VBA. This article will give you an insight about some important and useful properties and methods of the Range Object.<\/p>\n \nAs I said above, in this article you are going to learn some useful properties and methods of Range Object. Before you go there, you should know what is Property<\/i> and <\/i>Method<\/i> of an Object in Excel VBA?<\/p>\n Property of an Object is something which has an Object. Basically it describes the Object.<\/p>\n Method of an Object is something which is performed on that Object. Typically following is the syntax of referring a Range in Excel VBA: Range(“A1:G5”)<\/p>\n <\/strong><\/p>\n Above statement will represent all the cells from A1 to G5 as shown in below pic:
\nIf I have a collection of Cells A1, B1, C1 and D1<\/strong> then I can say that this is a Range from A1<\/strong> to D1<\/strong>. Sequence of cells can be Vertical<\/strong> or Horizontal<\/strong> or both at the same time which will represent a range in a tabular format.\n<\/p>\nWhat is Property of an Object?<\/h1>\n
What is Method of an Object?<\/h1>\n
\nThis is the main difference between a property and method of an Object. Method is an action which is performed on an Object and Property is something which defines the object.\n<\/p>\nSyntax<\/h2>\n
\n<\/p>\n
\n
\n