• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Use of /s while coding

Bhawani

Member
Dears,

i am adding shape thru my coding below is sample, but while declaring object use of "S" thing confuses me always.
i.e. whether to use shape/shapes how could i identify this.
Code:
Sub test()
Dim sh As Shape
Set sh = ThisWorkbook.ActiveSheet.Shapes.AddShape(msoShapePentagon, 5, 5, 5, 5)
End Sub

Sub test2()
Dim shp As Shape, shps As Shapes
Set shp = ThisWorkbook.ActiveSheet.shps.AddShape(msoShapePentagon, 5, 5, 5, 5)
End Sub

Regards,
 
Sometimes collection objects are known by a extras 's' depending how same is written in coding language.

Worksheet for a single sheet but worksheets for collection/array of sheets.
Workbook for a single xl but workbooks for collection/array of xls.
But range is not to be written as ranges anyhow as we declare/use how objects exists in coding language(here VBA)

http://www.ozgrid.com/VBA/shapes.htm
 
Back
Top