View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Harald Staff[_7_] Harald Staff[_7_] is offline
external usenet poster
 
Posts: 2
Default Macro to modify property of an object

Hi

Sub Macro1()
DTPicker1.Enabled = False
DTPicker2.Enabled = False
End Sub

Contols are not part of any useful collection -unless you create one. Text
loops like
Controls("DTPicker" & i).Enabled = False
are shorter to write but I believe they run slower.

Best wishes Harald

"exceluser" skrev i melding
...
In Excel 2007, how would you write a macro to set the Enabled property
of multiple DTPicker objects ?

The DTPicker object comes from the Microsoft Date and Time Picker
Control 6.0.

http://support.microsoft.com/kb/297381

For example, there are two DTPicker objects, DTPicker1 and DTPicker2.

Macro1 will set their Enabled property to TRUE.

Macro2 will set their Enabled property to FALSE.



Exceluser