Checking1

What is hierarchy of Objects in Excel VBA and Shape Object?


What is hierarchy of Objects in Excel VBA  and Shape Object?

In this blog we will learn hierarchy of  VBA Objects and will discuss about Shape Object. Let's see in below image example of Shape Object. Shape Object use to create shapes in Excel as per our requirements. Here we are taking example of a rectangle shape.  

Followus


Code

Sub ShapeObjectinVBA()

With Worksheets(1).Shapes.AddShape(msoShapeRoundedRectangle, _
150, 70, 70, 80)
.Name = " ShapeObjectinVBA"

End With

End Sub

Sub SelectShapesinActiveExcelSheet()

ActiveSheet.Shapes.SelectAll

End Sub

Output : Refer first image to see created rectangle its created after Run the first code. Also take look on created rectangle in first image for second code out put when we run the selector code it select the created image automatically.
 

Excel VBA Hierarchy model (Nested use of Objects)

Here we are taking a example to understand the hierarchical use of VBA Objects . Let's assume we need to select a Range("D4") in a Sheet1 of  Workbook (Book1) .

Code

Sub HierachicalUseofVBAObjects()

Workbooks("Book1").Worksheets("Sheet1").Range("D4").Select

End Sub

Output

After Run Above code we got selected D4 Range in Sheet1 of  Book1 Workbook. Let's fill the Range D4 with 100 Number using a VBA code. Take a look on below image.


Thanks for visiting @ Bexpertadvexel.com Blogs


Click on the Link for Join us : Register_Course

We at BeXpert Advanced Excel offer state of the art Advanced Excel Coaching at Home. Even corporate professionals comes to us, for Advanced Excel Training in Gurgaon for the same state of the art database management education.

Other Services : We provide Automated Tools for reporting and analysis your business Data Automatically using some simple steps in User from and Command buttons.




You can place Your order on Fiverr bexpertadvexcel

No comments:

Post a Comment

Feel free to ask your questions regarding Ms Excel & VBA macros.

Featured Post

स्तर 2: बुनियादी अंकगणितीय क्रियाएँ

स्तर 2: बुनियादी अंकगणितीय क्रियाएँ हमारे अबेकस कक्षाओं के स्तर 2 में, हम उन महत्वपूर्ण अंकगणितीय क्रियाओं पर ध्यान केंद्रित करते हैं जो गणि...

LearnVBAbigners