WORKING
WITH
SHAPES
VBA-EXCEL
Variant
Vertices
Group Items
HEIGHT WIDTH
1
2
Z-Order Position
Item
Array of
coordinate
points
R Add Curve
Add Polyline
¿Vs. Nodes
Shape Nodes
collection
Variant
Vertices
Group Items
HEIGHT WIDTH
H
W
1
2
Z-Order Position
Item
Array of
coordinate
points
R Add Curve
Add Polyline
¿Vs. Nodes
Shape Nodes
collection
Points Values
A
B C
Objective
Objective
.Name.
Sets a String Value
.representing name of
object
LINE /LINE FORMAT
Ajustes
Shape Range
Object
Shape Determinations
< [[PROPERTIES] ]
hitherto
Objective
OLE
SHAPE RANGE CK.
ie. Dwgs +> .jpgs
.gifs
PICTURE FORMAT
< [[PROPERTIES] ]
hitherto
Objective
OLE
SHAPE RANGE CK.
ie. Dwgs +> .jpgs
.gifs
PICTURE FORMAT
Ajustes
Shape Range
Object
< [[PROPERTIES] ]
hitherto
Shape Style
from
MSOShapeStyleIndex
Loop Shapes
verify
Lock Aspect Ratio
Unless
applying
adjustable
Shape
scenario
ShapeTypeMSOShapeType
Objective
Alternative Text
{for Shapes}
| Shape Range |
WEBPAGE
Background Style
< [[PROPERTIES] ]
hitherto
“Build Free From”
Add Notes
Common to Shape
E n d W i t h
Collection of Shape Objects
{Shapes Object Members}
W ith FreeFormBuilder
d e c y D o c u m e n t . S h a p e s . B F F ( m s o E d i t i n g C o r n e r
3 6 0 , 2 0 0 )
Ie.
.AddNodes msoSegmentCurve,
msoEditingCorner,_380,230,400,250 etc.
.ConvertToShape
Objective
Align: aligns shapes in a specified range.
METHODS
Regroup – Shapes
become Shape Object
[group has [Z-order]
.Item returns single object
from a collection
Increment | Rotation
Increment | Left
| Top
Selec ts the objec t
s e t S h a p e s D e f f a u l t P r o p e r t i e s
Apply |{ }| [Pick Up] Method.
Formatting Copy-paste to shapes
Scale height
Scale Width
Distribute Range Shapes
Objective
MyDocument.Shapes.item(i).Type = msoAutoShape
____
msoShapeType Enumeration
SHAPES
Shape
Shapes
.Count
.Item
Properties xOn Action
shape xNodes
xOn Action
Shape xControlFormat
.LockAspectRatio
.Child
.ParentGroup
Method
xSetShapes Default Properties
xReroute Connections
xIncrementLeft
xIncrementRotation
.PickUp
.ScaleWidth
.ScaleHeight
.
Shape Object Members
On Nodes.Count as MyDocument.Shapes(3).Nodes
groupProperty
msoEditingType
REDIM
H
W
Q: ¿ .Count is a
Static Value ?
A: It is a read only
property of a
Collection
Reallocate storage space
for dynamic array variables.
VBA Checks through
each node to verify
type of “condition” and
assigns “quality”.
¿Vs. Nodes
Shape Nodes
collection
Shape Node .EditingType ‘read only.’
msoEditing /corner
.SetEditing Type
msoEditing Smooth
¿free form dwg?
On Nodes.Count as MyDocument.Shapes(3).Nodes
groupProperty
msoEditingType
REDIM
H
W
VBA Checks through
each node to verify
type of “condition” and
assigns “quality”.
¿Vs. Nodes
Shape Nodes
collection
msoEditing /corner
.SetEditing Type
msoEditing Smooth
¿free form dwg?
[ On.Distribute( _ , _ )
Let myDocument = Worksheets(1)
With myDocument.Shapes
nomShapes = .Count
If numShapes > 1 Then
numAutoShapes = 0 { initialize }
{ReDim autoShpArray.(1 to (.Count)numShapes)}
For i = 1 to numShapes
if .item(i).Type = msoAutoShape then…
dynamic
array
Objective
Test each shape
Set Method
apply Property
End Test
End Loop
3 OBJECTS
SHAPES COLLECTION: SHAPE RANGE COLLECTION: SHAPE OBJECT
Loop through collection Shape Range
Shapes are not confined by Excel Versions
previous to ¿’07 to ‘010
Objective
Test each shape
Set Method
apply Property
End Test
End Loop
SHAPE RANGE COLLECTION
CONTAINS ALL SHAPES ON A SHEET
With ShapeRange Property
╘ return ShapeRange object
containing selected shapes.
Worksheets(1).Shapes.Select
Set sr = selection.ShapeRange
Index
create a ShapeRange Object
containing all shapes in a
Shape collection.
H
W
Objective
Shapes defined for the index of
worksheets. So re-define
worksheet
See i) myDocument = worksheets(1)
for Each Sh In myDocument.Shapes
{actions applied to sh. property. }
2010 DEVELOPER REFERENCE
“WORKING WITH SHAPES”
Applying a Property Or a Method to
a ShapeRange Collection
<<((hypothesize))>>
Exterior
looping through worksheets
ie. MyDocument =
Workbook(“ “)
For each Wksht In
MyDocument.Wksht
Wksht.Selection.ShapeRange
Objective
“ . “ Title. Text = “___” & vbcr & “___” &_
Iif ( Range( “units” ) = “___”, “___”, “___”, “___” )
ActiveChart.Deselect.
‘’ACTIVE
[ Active Sheet.ChartObjects(“ChartName”).Activate ]
Shapes are not confined by Excel Versions
previous to ¿’07 to ‘010
ThisWorkbook.Path.
&” ___.g.b ” etc.
Created an image 1
Range
Evaluate
changing
variables
{Single
formula}
Objective
‘’ACTIVE
Autofill create list
of ordered
numbers.
Generate in vba
to paste values in
column.
ie. No formulas
for “data tables”in
first column.
Ref; Susan Harkins | Tech Republic
{ if error function } for distributable
Once data table is in
place; can’t change
any referencing
cells. (B,C,+D in
data table)
Data table are a
series of =TABLE()
functions
Data Table
Enter data table labels
Verify first column
variable matches.
Input cell amount.
Input of first row
from result cells.
Go to “what if and
…”
In Data Tools group.
Column input = input
cell .Value
.$R$C
Objective
Returns Value of Table or Range
INDEX
Worksheet.Index(Arg 1, Arg 2, Arg 3, Arg 4)
ThisWorkbook.Path.
&” ___.g.b ” etc.
Arg 1 Range or Array const. ref. one or more cell ranges.
Arg 2 Row_num
Arg 3 Column_num
Arg 4 Area_num
if omitted, range of, area_num is returned
If row or column are omitted, column or row are returned
Purpose ie
Wood Tables
‘The result of the INDEX function is a
reference ex.:CELL(“width”,…) ‘
Objective
[ relative position in an array. (Value1, Value2, Value3) ]
Vs. Lookup for position vs. Range item eg.
MATCH
Worksheet.Match(Arg 1, Arg 2, Arg 3)
eg.
Order
1,2,3,example
Arg 1 Lookup_Value
Arg 2 Row_num
Arg 3 Match_type
Using number or text etc. or cell reference.
Lookup_array: contiguous range of cells. Containing
possible lookup values.
Lookup_array : array or reference.
Match_type -1, 0, or 1 {matching ARG 1} how (min ≥) = (≤ max)
A B
8
9
14 16
20 40
<<((paraphrase))>> Match A8 -> A8 vs. Lookup A8 ->14
Excel No. False
Selection.ShapeRange.Align msoAlignLefts,False
Methods of Shapes in Shape
Range
Align
Distribute
Group
Regroup
ALIGN Align
expression.Align (Align.cmd,Relative To)
msoAlignCmd
Align Cmd
Relative To
“Arrange all shapes in the specified range with left
edge of left most shape in the range.”
Reference
With{Define “Visual groups (vbgroups)”

More Related Content

DOC
Sql functions
PDF
Stata Cheat Sheets (all)
PPT
UML and You
PDF
Stata cheatsheet transformation
PDF
Stata cheat sheet: data processing
PDF
Better d3 charts with tdd
PDF
Stata cheat sheet: data transformation
Sql functions
Stata Cheat Sheets (all)
UML and You
Stata cheatsheet transformation
Stata cheat sheet: data processing
Better d3 charts with tdd
Stata cheat sheet: data transformation

What's hot (20)

PDF
PDF
Stata Programming Cheat Sheet
PDF
Arrays In C
PPTX
PPTX
Programming in c arrays
PDF
Stata cheat sheet analysis
PDF
Power of functions in a typed world
PPTX
Multi-Dimensional Lists
PDF
6. R data structures
PDF
Data Types and Structures in R
PPT
Les09 (using ddl statements to create and manage tables)
PPTX
Programming in c Arrays
PPTX
MongoDB
PDF
2 data structure in R
PPTX
PPTX
Project Milestone Tracking in JIRA Issues
PPTX
Two-dimensional array in java
PDF
Data Wrangling with dplyr and tidyr Cheat Sheet
PPT
Module03
PPT
Db1 lecture4
Stata Programming Cheat Sheet
Arrays In C
Programming in c arrays
Stata cheat sheet analysis
Power of functions in a typed world
Multi-Dimensional Lists
6. R data structures
Data Types and Structures in R
Les09 (using ddl statements to create and manage tables)
Programming in c Arrays
MongoDB
2 data structure in R
Project Milestone Tracking in JIRA Issues
Two-dimensional array in java
Data Wrangling with dplyr and tidyr Cheat Sheet
Module03
Db1 lecture4
Ad

Similar to Working with shapes (20)

PPTX
SQL data types: INT, VARCHAR, CHAR,.pptx
PPT
04 Introduction to SQ(Structural Query Language)L.ppt
PPT
UNIT 2 Structured query language commands
PDF
Introduction to DAX Language
PDF
DP080_Lecture_2 SQL related document.pdf
PDF
Programming in Scala - Lecture Three
PPTX
Pandas csv
PPT
SQL.ppt
PPTX
R You Ready? An I/O Psychologist's Guide to R and Rstudio
PPT
Arrays and vectors in Data Structure.ppt
PPTX
R교육1
PPTX
Introduction to Client-Side Javascript
PPTX
Taxonomy of Scala
PPT
SQL select statement and functions
PDF
PPT
SQL : introduction
PPT
Chapter 08
PPTX
arrays.pptx
PPT
slidlecturlecturlecturlecturlecturlecturlecturlectures06.ppt
PPT
Arrays in Java Programming Language slides
SQL data types: INT, VARCHAR, CHAR,.pptx
04 Introduction to SQ(Structural Query Language)L.ppt
UNIT 2 Structured query language commands
Introduction to DAX Language
DP080_Lecture_2 SQL related document.pdf
Programming in Scala - Lecture Three
Pandas csv
SQL.ppt
R You Ready? An I/O Psychologist's Guide to R and Rstudio
Arrays and vectors in Data Structure.ppt
R교육1
Introduction to Client-Side Javascript
Taxonomy of Scala
SQL select statement and functions
SQL : introduction
Chapter 08
arrays.pptx
slidlecturlecturlecturlecturlecturlecturlecturlectures06.ppt
Arrays in Java Programming Language slides
Ad

More from NAXUTL, StratGlobal, Nature Acoustical (20)

PPTX
Formwork &amp; falsework
PPTX
PPTX
PPTX
Water composition urban street
PPTX
Drift control , ‘apply it
PPTX
To agronomize city infrastructure
PPTX
Earthquake Novel Concept Japan
PPTX
11 structural and architectural - san diego012013
PPTX
PPTX
PPTX
Create an autocad profile
PPTX
PPTX

Recently uploaded (20)

PDF
GENERATOR AND IMPROVED COIL THEREFOR HAVINGELECTRODYNAMIC PROPERTIES
PPTX
Unit-1.pptxgeyeuueueu7r7r7r77r7r7r7uriruru
PPTX
vortex flow measurement in instrumentation
PPTX
AI_ML_Internship_WReport_Template_v2.pptx
PPTX
Pin configuration and project related to
PDF
ICT grade for 8. MATATAG curriculum .P2.pdf
PPTX
Computer Hardware - Technology and Livelihood Education
DOCX
Copy-OT LIST 12.8.25.docxjdjfufufufufuuffuf
PDF
20A LG INR18650HJ2 3.6V 2900mAh Battery cells for Power Tools Vacuum Cleaner
PDF
Maxon CINEMA 4D 2025 Crack Free Download Latest Version
PPTX
Subordinate_Clauses_BlueGradient_Optimized.pptx
PPTX
Chapter no 8 output devices dpart 2.pptx
PDF
2_STM32&SecureElements2_STM32&SecureElements
PPTX
ELETRONIC-PRODUCTS-ASSEMBLY-AND-SERVICING-NC-II-WEEK-1-Copy.pptx
PPTX
Clauses_Part1.hshshpjzjxnznxnxnndndndndndndndnndptx
PPTX
unit1d-communitypharmacy-240815170017-d032dce8.pptx
PDF
2- Physical Layer (06).pdfgshshshbsbshshshhs
PPTX
New professional education PROF-ED-7_103359.pptx
PPT
System Unit Components and its Functions
PDF
PakistanCoinageAct-906.pdfdbnsshsjjsbsbb
GENERATOR AND IMPROVED COIL THEREFOR HAVINGELECTRODYNAMIC PROPERTIES
Unit-1.pptxgeyeuueueu7r7r7r77r7r7r7uriruru
vortex flow measurement in instrumentation
AI_ML_Internship_WReport_Template_v2.pptx
Pin configuration and project related to
ICT grade for 8. MATATAG curriculum .P2.pdf
Computer Hardware - Technology and Livelihood Education
Copy-OT LIST 12.8.25.docxjdjfufufufufuuffuf
20A LG INR18650HJ2 3.6V 2900mAh Battery cells for Power Tools Vacuum Cleaner
Maxon CINEMA 4D 2025 Crack Free Download Latest Version
Subordinate_Clauses_BlueGradient_Optimized.pptx
Chapter no 8 output devices dpart 2.pptx
2_STM32&SecureElements2_STM32&SecureElements
ELETRONIC-PRODUCTS-ASSEMBLY-AND-SERVICING-NC-II-WEEK-1-Copy.pptx
Clauses_Part1.hshshpjzjxnznxnxnndndndndndndndnndptx
unit1d-communitypharmacy-240815170017-d032dce8.pptx
2- Physical Layer (06).pdfgshshshbsbshshshhs
New professional education PROF-ED-7_103359.pptx
System Unit Components and its Functions
PakistanCoinageAct-906.pdfdbnsshsjjsbsbb

Working with shapes

  • 2. Variant Vertices Group Items HEIGHT WIDTH 1 2 Z-Order Position Item Array of coordinate points R Add Curve Add Polyline ¿Vs. Nodes Shape Nodes collection
  • 3. Variant Vertices Group Items HEIGHT WIDTH H W 1 2 Z-Order Position Item Array of coordinate points R Add Curve Add Polyline ¿Vs. Nodes Shape Nodes collection Points Values A B C Objective
  • 4. Objective .Name. Sets a String Value .representing name of object LINE /LINE FORMAT Ajustes Shape Range Object Shape Determinations < [[PROPERTIES] ] hitherto
  • 5. Objective OLE SHAPE RANGE CK. ie. Dwgs +> .jpgs .gifs PICTURE FORMAT < [[PROPERTIES] ] hitherto
  • 6. Objective OLE SHAPE RANGE CK. ie. Dwgs +> .jpgs .gifs PICTURE FORMAT Ajustes Shape Range Object < [[PROPERTIES] ] hitherto Shape Style from MSOShapeStyleIndex Loop Shapes verify Lock Aspect Ratio Unless applying adjustable Shape scenario ShapeTypeMSOShapeType
  • 7. Objective Alternative Text {for Shapes} | Shape Range | WEBPAGE Background Style < [[PROPERTIES] ] hitherto “Build Free From” Add Notes Common to Shape E n d W i t h Collection of Shape Objects {Shapes Object Members} W ith FreeFormBuilder d e c y D o c u m e n t . S h a p e s . B F F ( m s o E d i t i n g C o r n e r 3 6 0 , 2 0 0 ) Ie. .AddNodes msoSegmentCurve, msoEditingCorner,_380,230,400,250 etc. .ConvertToShape
  • 8. Objective Align: aligns shapes in a specified range. METHODS Regroup – Shapes become Shape Object [group has [Z-order] .Item returns single object from a collection Increment | Rotation Increment | Left | Top Selec ts the objec t s e t S h a p e s D e f f a u l t P r o p e r t i e s Apply |{ }| [Pick Up] Method. Formatting Copy-paste to shapes Scale height Scale Width Distribute Range Shapes
  • 9. Objective MyDocument.Shapes.item(i).Type = msoAutoShape ____ msoShapeType Enumeration SHAPES Shape Shapes .Count .Item Properties xOn Action shape xNodes xOn Action Shape xControlFormat .LockAspectRatio .Child .ParentGroup Method xSetShapes Default Properties xReroute Connections xIncrementLeft xIncrementRotation .PickUp .ScaleWidth .ScaleHeight . Shape Object Members
  • 10. On Nodes.Count as MyDocument.Shapes(3).Nodes groupProperty msoEditingType REDIM H W Q: ¿ .Count is a Static Value ? A: It is a read only property of a Collection Reallocate storage space for dynamic array variables. VBA Checks through each node to verify type of “condition” and assigns “quality”. ¿Vs. Nodes Shape Nodes collection Shape Node .EditingType ‘read only.’ msoEditing /corner .SetEditing Type msoEditing Smooth ¿free form dwg?
  • 11. On Nodes.Count as MyDocument.Shapes(3).Nodes groupProperty msoEditingType REDIM H W VBA Checks through each node to verify type of “condition” and assigns “quality”. ¿Vs. Nodes Shape Nodes collection msoEditing /corner .SetEditing Type msoEditing Smooth ¿free form dwg? [ On.Distribute( _ , _ ) Let myDocument = Worksheets(1) With myDocument.Shapes nomShapes = .Count If numShapes > 1 Then numAutoShapes = 0 { initialize } {ReDim autoShpArray.(1 to (.Count)numShapes)} For i = 1 to numShapes if .item(i).Type = msoAutoShape then… dynamic array
  • 12. Objective Test each shape Set Method apply Property End Test End Loop 3 OBJECTS SHAPES COLLECTION: SHAPE RANGE COLLECTION: SHAPE OBJECT Loop through collection Shape Range Shapes are not confined by Excel Versions previous to ¿’07 to ‘010
  • 13. Objective Test each shape Set Method apply Property End Test End Loop SHAPE RANGE COLLECTION CONTAINS ALL SHAPES ON A SHEET With ShapeRange Property ╘ return ShapeRange object containing selected shapes. Worksheets(1).Shapes.Select Set sr = selection.ShapeRange Index create a ShapeRange Object containing all shapes in a Shape collection. H W
  • 14. Objective Shapes defined for the index of worksheets. So re-define worksheet See i) myDocument = worksheets(1) for Each Sh In myDocument.Shapes {actions applied to sh. property. } 2010 DEVELOPER REFERENCE “WORKING WITH SHAPES” Applying a Property Or a Method to a ShapeRange Collection <<((hypothesize))>> Exterior looping through worksheets ie. MyDocument = Workbook(“ “) For each Wksht In MyDocument.Wksht Wksht.Selection.ShapeRange
  • 15. Objective “ . “ Title. Text = “___” & vbcr & “___” &_ Iif ( Range( “units” ) = “___”, “___”, “___”, “___” ) ActiveChart.Deselect. ‘’ACTIVE [ Active Sheet.ChartObjects(“ChartName”).Activate ] Shapes are not confined by Excel Versions previous to ¿’07 to ‘010 ThisWorkbook.Path. &” ___.g.b ” etc. Created an image 1
  • 16. Range Evaluate changing variables {Single formula} Objective ‘’ACTIVE Autofill create list of ordered numbers. Generate in vba to paste values in column. ie. No formulas for “data tables”in first column. Ref; Susan Harkins | Tech Republic { if error function } for distributable Once data table is in place; can’t change any referencing cells. (B,C,+D in data table) Data table are a series of =TABLE() functions Data Table Enter data table labels Verify first column variable matches. Input cell amount. Input of first row from result cells. Go to “what if and …” In Data Tools group. Column input = input cell .Value .$R$C
  • 17. Objective Returns Value of Table or Range INDEX Worksheet.Index(Arg 1, Arg 2, Arg 3, Arg 4) ThisWorkbook.Path. &” ___.g.b ” etc. Arg 1 Range or Array const. ref. one or more cell ranges. Arg 2 Row_num Arg 3 Column_num Arg 4 Area_num if omitted, range of, area_num is returned If row or column are omitted, column or row are returned Purpose ie Wood Tables ‘The result of the INDEX function is a reference ex.:CELL(“width”,…) ‘
  • 18. Objective [ relative position in an array. (Value1, Value2, Value3) ] Vs. Lookup for position vs. Range item eg. MATCH Worksheet.Match(Arg 1, Arg 2, Arg 3) eg. Order 1,2,3,example Arg 1 Lookup_Value Arg 2 Row_num Arg 3 Match_type Using number or text etc. or cell reference. Lookup_array: contiguous range of cells. Containing possible lookup values. Lookup_array : array or reference. Match_type -1, 0, or 1 {matching ARG 1} how (min ≥) = (≤ max) A B 8 9 14 16 20 40 <<((paraphrase))>> Match A8 -> A8 vs. Lookup A8 ->14
  • 19. Excel No. False Selection.ShapeRange.Align msoAlignLefts,False Methods of Shapes in Shape Range Align Distribute Group Regroup ALIGN Align expression.Align (Align.cmd,Relative To) msoAlignCmd Align Cmd Relative To “Arrange all shapes in the specified range with left edge of left most shape in the range.” Reference With{Define “Visual groups (vbgroups)”