Microsoft Office Development and Consultancy
 Home|

Excel

|VBA|C#|Finance|Tools|Newsletter|Feedback|Contact 
 Excel > Worksheet Controls > VBA Code > Forms< Previous | Next > 

 

Using the Shapes Collection

 
 

This is the only method you use to refer to controls that have been added from the Forms toolbar.

 
 
1
2
3
4
5
6
7
8
ActiveSheet.Shapes("Check Box 1").Select
ActiveSheet.Shapes("Check Box 1").LinkedCell = "H2"
Dim shShape As Shape
For Each shShape in ActiveSheet.Shapes
   If shShape.Type = msoFormControl Then
      shShape.Select
   End If
Next shShape
   


 

Adding Controls

 
 
9
10
Dim objButton As Variant
Set objbutton = Worksheets("Sheet1").Buttons.Add(20,20,20,20)
   



 

Handling Events

 
 

The controls on the Forms toolbar can only respond to a single event, the click event.

 
 

The only exception is the Edit control which responds to a Change event.

 




 © Better Solutions Limited 10-May-2013< Previous | Top | Next >